initial wip implementation of config element click listeners

This commit is contained in:
AndyScherzinger 2016-10-06 23:22:56 +02:00
parent 4796633bcd
commit ccb16b7cc4
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
2 changed files with 45 additions and 5 deletions

View file

@ -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"

View file

@ -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;
}