use of com.trovebox.android.common.util.data.StringMapParcelableWrapper in project mobile-android by photo.
the class SyncUploadFragment method onActivityResult.
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch(requestCode) {
case REQUEST_ALBUMS:
if (resultCode == Activity.RESULT_OK && data.getExtras() != null) {
StringMapParcelableWrapper albumsWrapper = data.getExtras().getParcelable(SelectAlbumsActivity.SELECTED_ALBUMS);
Map<String, String> albums = albumsWrapper.getMap();
albumsText.setText(AlbumUtils.getAlbumsString(albums));
this.albumsWrapper = albumsWrapper;
}
break;
default:
break;
}
}
use of com.trovebox.android.common.util.data.StringMapParcelableWrapper in project mobile-android by photo.
the class SyncUploadFragment method init.
public void init(View v, Bundle savedInstanceState) {
final Button uploadBtn = (Button) v.findViewById(R.id.uploadBtn);
uploadBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
TrackerUtils.trackButtonClickEvent("uploadBtn", SyncUploadFragment.this);
if (!UploadUiFragment.checkAlbumRequiredAndSpecified(albumsWrapper)) {
return;
}
v.setEnabled(false);
uploadSelectedFiles(true, true);
}
});
uploadBtn.setEnabled(false);
editTitle = (EditText) v.findViewById(R.id.edit_title);
editTags = (EditText) v.findViewById(R.id.edit_tags);
albumsText = ((EditText) v.findViewById(R.id.edit_albums));
albumsText.setVisibility(Preferences.isLimitedAccountAccessType() ? View.GONE : View.VISIBLE);
privateSwitch = (Switch) v.findViewById(R.id.private_switch);
twitterSwitch = (Switch) v.findViewById(R.id.twitter_switch);
facebookSwitch = (Switch) v.findViewById(R.id.facebook_switch);
albumsText.setOnClickListener(this);
if (Preferences.isLimitedAccountAccessType()) {
privateSwitch.setChecked(true);
privateSwitch.setEnabled(false);
}
privateSwitch.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
reinitShareSwitches(!isChecked);
}
});
reinitShareSwitches();
AccountLimitUtils2.tryToRefreshLimitInformationAndRunInContextAsync(new Runnable() {
@Override
public void run() {
if (!isAdded()) {
return;
}
UploadUiFragment.checkCanUpload(albumsText, uploadBtn, new RunnableWithParameter<StringMapParcelableWrapper>() {
@Override
public void run(StringMapParcelableWrapper parameter) {
SyncUploadFragment.this.albumsWrapper = parameter;
}
});
}
}, new Runnable() {
@Override
public void run() {
CommonUtils.debug(TAG, "Limit information refresh failed");
}
}, loadingControl);
}
Aggregations