mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +03:00
initial wip implementation of config element click listeners
This commit is contained in:
parent
4796633bcd
commit
ccb16b7cc4
2 changed files with 45 additions and 5 deletions
|
@ -161,6 +161,7 @@
|
|||
android:textColor="@color/color_accent"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/setting_instant_upload_on_wifi_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipToPadding="false"
|
||||
|
@ -175,7 +176,7 @@
|
|||
android:paddingTop="@dimen/standard_padding">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/setting_instant_upload_on_wifi"
|
||||
android:id="@+id/setting_instant_upload_on_wifi_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="marquee"
|
||||
|
@ -206,6 +207,7 @@
|
|||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/setting_instant_upload_on_charging_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipToPadding="false"
|
||||
|
@ -220,7 +222,7 @@
|
|||
android:paddingTop="@dimen/standard_padding">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/setting_instant_upload_on_charging"
|
||||
android:id="@+id/setting_instant_upload_on_charging_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="marquee"
|
||||
|
@ -251,6 +253,7 @@
|
|||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/setting_instant_upload_path_use_subfolders_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipToPadding="false"
|
||||
|
@ -265,7 +268,7 @@
|
|||
android:paddingTop="@dimen/standard_padding">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/setting_instant_upload_path_use_subfolders_title"
|
||||
android:id="@+id/setting_instant_upload_path_use_subfolders_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="marquee"
|
||||
|
@ -277,8 +280,8 @@
|
|||
android:id="@+id/setting_instant_upload_path_use_subfolders_summary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@id/setting_instant_upload_path_use_subfolders_title"
|
||||
android:layout_below="@id/setting_instant_upload_path_use_subfolders_title"
|
||||
android:layout_alignLeft="@id/setting_instant_upload_path_use_subfolders_label"
|
||||
android:layout_below="@id/setting_instant_upload_path_use_subfolders_label"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:text="@string/prefs_instant_upload_path_use_subfolders_summary"
|
||||
|
|
|
@ -30,6 +30,7 @@ import android.view.View;
|
|||
import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.owncloud.android.R;
|
||||
|
@ -47,6 +48,9 @@ public class SyncedFolderPreferencesDialogFragment extends DialogFragment {
|
|||
public static final String SYNCED_FOLDER_PARCELABLE = "SyncedFolderParcelable";
|
||||
|
||||
protected View mView = null;
|
||||
private CheckBox mUploadOnWifiCheckbox;
|
||||
private CheckBox mUploadOnChargingCheckbox;
|
||||
private CheckBox mUploadUseSubfoldersCheckbox;
|
||||
|
||||
private SyncedFolderParcelable mSyncedFolder;
|
||||
|
||||
|
@ -105,6 +109,39 @@ public class SyncedFolderPreferencesDialogFragment extends DialogFragment {
|
|||
((TextView) mView.findViewById(R.id.local_folder_summary)).setText(mSyncedFolder.getLocalPath());
|
||||
((TextView) mView.findViewById(R.id.remote_folder_summary)).setText(mSyncedFolder.getRemotePath());
|
||||
|
||||
// TODO add all necessary listeners and fields
|
||||
|
||||
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
|
||||
.setting_instant_upload_path_use_subfolders_checkbox);
|
||||
|
||||
// TODO create separate setup methods to keep code easy to read
|
||||
|
||||
mView.findViewById(R.id.setting_instant_upload_on_wifi_container).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// TODO save checkbox state to boolean
|
||||
mUploadOnWifiCheckbox.toggle();
|
||||
}
|
||||
});
|
||||
|
||||
mView.findViewById(R.id.setting_instant_upload_on_charging_container).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// TODO save checkbox state to boolean
|
||||
mUploadOnChargingCheckbox.toggle();
|
||||
}
|
||||
});
|
||||
|
||||
mView.findViewById(R.id.setting_instant_upload_path_use_subfolders_container).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// TODO save checkbox state to boolean
|
||||
mUploadUseSubfoldersCheckbox.toggle();
|
||||
}
|
||||
});
|
||||
|
||||
return mView;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue