fix synced folder settings dialog theming + code cleanup

This commit is contained in:
AndyScherzinger 2016-10-24 15:52:16 +02:00
parent 85b2223d09
commit 9efa7de760
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
3 changed files with 15 additions and 18 deletions

View file

@ -195,7 +195,7 @@
android:orientation="vertical"
android:paddingLeft="@dimen/standard_padding">
<CheckBox
<android.support.v7.widget.AppCompatCheckBox
android:id="@+id/setting_instant_upload_on_wifi_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -241,7 +241,7 @@
android:orientation="vertical"
android:paddingLeft="@dimen/standard_padding">
<CheckBox
<android.support.v7.widget.AppCompatCheckBox
android:id="@+id/setting_instant_upload_on_charging_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -299,7 +299,7 @@
android:orientation="vertical"
android:paddingLeft="@dimen/standard_padding">
<CheckBox
<android.support.v7.widget.AppCompatCheckBox
android:id="@+id/setting_instant_upload_path_use_subfolders_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

View file

@ -334,8 +334,8 @@ public class FolderSyncActivity extends FileActivity implements FolderSyncAdapte
FragmentTransaction ft = fm.beginTransaction();
ft.addToBackStack(null);
mSyncedFolderPreferencesDialogFragment = SyncedFolderPreferencesDialogFragment.newInstance(syncedFolderDisplayItem,
section);
mSyncedFolderPreferencesDialogFragment = SyncedFolderPreferencesDialogFragment.newInstance(
syncedFolderDisplayItem, section);
mSyncedFolderPreferencesDialogFragment.show(ft, SYNCED_FOLDER_PREFERENCES_DIALOG_TAG);
}

View file

@ -42,8 +42,7 @@ import com.owncloud.android.ui.activity.FolderPickerActivity;
import com.owncloud.android.ui.dialog.parcel.SyncedFolderParcelable;
/**
* Dialog to show the preferences/configuration of a synced folder allowing the user
* to change the different parameters.
* Dialog to show the preferences/configuration of a synced folder allowing the user to change the different parameters.
*/
public class SyncedFolderPreferencesDialogFragment extends DialogFragment {
@ -52,7 +51,6 @@ public class SyncedFolderPreferencesDialogFragment extends DialogFragment {
public static final int REQUEST_CODE__SELECT_REMOTE_FOLDER = 0;
private CharSequence[] mUploadBehaviorItemStrings;
private CharSequence[] mUploadBehaviorItemValues;
protected View mView = null;
private CheckBox mUploadOnWifiCheckbox;
@ -63,7 +61,6 @@ public class SyncedFolderPreferencesDialogFragment extends DialogFragment {
private TextView mRemoteFolderSummary;
private SyncedFolderParcelable mSyncedFolder;
private int mSection;
public static SyncedFolderPreferencesDialogFragment newInstance(SyncedFolderDisplayItem syncedFolder, int section) {
SyncedFolderPreferencesDialogFragment dialogFragment = new SyncedFolderPreferencesDialogFragment();
@ -75,6 +72,7 @@ public class SyncedFolderPreferencesDialogFragment extends DialogFragment {
Bundle args = new Bundle();
args.putParcelable(SYNCED_FOLDER_PARCELABLE, new SyncedFolderParcelable(syncedFolder, section));
dialogFragment.setArguments(args);
dialogFragment.setStyle(STYLE_NORMAL,R.style.Theme_ownCloud_Dialog);
return dialogFragment;
}
@ -99,7 +97,6 @@ public class SyncedFolderPreferencesDialogFragment extends DialogFragment {
mSyncedFolder = getArguments().getParcelable(SYNCED_FOLDER_PARCELABLE);
mUploadBehaviorItemStrings = getResources().getTextArray(R.array.pref_behaviour_entries);
mUploadBehaviorItemValues = getResources().getTextArray(R.array.pref_behaviour_entryValues);
}
@Override
@ -124,15 +121,15 @@ public class SyncedFolderPreferencesDialogFragment extends DialogFragment {
*/
private void setupDialogElements(View view) {
// find/saves UI elements
mLocalFolderSummary = (TextView) mView.findViewById(R.id.local_folder_summary);
mRemoteFolderSummary = (TextView) mView.findViewById(R.id.remote_folder_summary);
mLocalFolderSummary = (TextView) view.findViewById(R.id.local_folder_summary);
mRemoteFolderSummary = (TextView) view.findViewById(R.id.remote_folder_summary);
mUploadOnWifiCheckbox = (CheckBox) mView.findViewById(R.id.setting_instant_upload_on_wifi_checkbox);
mUploadOnChargingCheckbox = (CheckBox) mView.findViewById(R.id.setting_instant_upload_on_charging_checkbox);
mUploadUseSubfoldersCheckbox = (CheckBox) mView.findViewById(R.id
mUploadOnWifiCheckbox = (CheckBox) view.findViewById(R.id.setting_instant_upload_on_wifi_checkbox);
mUploadOnChargingCheckbox = (CheckBox) view.findViewById(R.id.setting_instant_upload_on_charging_checkbox);
mUploadUseSubfoldersCheckbox = (CheckBox) view.findViewById(R.id
.setting_instant_upload_path_use_subfolders_checkbox);
mUploadBehaviorSummary = (TextView) mView.findViewById(R.id.setting_instant_behaviour_summary);
mUploadBehaviorSummary = (TextView) view.findViewById(R.id.setting_instant_behaviour_summary);
// Set values
mLocalFolderSummary.setText(mSyncedFolder.getLocalPath());
@ -258,8 +255,8 @@ public class SyncedFolderPreferencesDialogFragment extends DialogFragment {
}
public interface OnSyncedFolderPreferenceListener {
public void onSaveSyncedFolderPreference(SyncedFolderParcelable syncedFolder);
void onSaveSyncedFolderPreference(SyncedFolderParcelable syncedFolder);
public void onCancelSyncedFolderPreference();
void onCancelSyncedFolderPreference();
}
}