From 50eeb2d7368109ea970cba48bfe4b65b20db0107 Mon Sep 17 00:00:00 2001 From: A117870935 Date: Sun, 14 May 2023 23:50:45 +0530 Subject: [PATCH] Customized Spinner. --- .../ui/activity/UploadFilesActivity.java | 7 +- app/src/main/res/drawable/bg_spinner.xml | 9 ++ .../main/res/layout/simple_spinner_item.xml | 10 +++ .../main/res/layout/upload_files_layout.xml | 2 + app/src/main/res/values-night/colors.xml | 64 +++++++++++++ app/src/main/res/values/colors.xml | 89 +++++++++++++++++++ app/src/main/res/values/styles.xml | 4 + 7 files changed, 184 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/drawable/bg_spinner.xml create mode 100644 app/src/main/res/layout/simple_spinner_item.xml diff --git a/app/src/main/java/com/owncloud/android/ui/activity/UploadFilesActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/UploadFilesActivity.java index 9dd891a1f9fe..9097797e8aba 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/UploadFilesActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/UploadFilesActivity.java @@ -18,6 +18,8 @@ import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; +import android.graphics.Color; +import android.graphics.PorterDuff; import android.os.Bundle; import android.os.Environment; import android.view.Menu; @@ -200,10 +202,12 @@ public void onCreate(Bundle savedInstanceState) { behaviours.add(getString(R.string.uploader_upload_files_behaviour_only_upload)); behaviours.add(getString(R.string.uploader_upload_files_behaviour_upload_and_delete_from_source)); - ArrayAdapter behaviourAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, + //custom spinner item layout for NMC + ArrayAdapter behaviourAdapter = new ArrayAdapter<>(this, R.layout.simple_spinner_item, behaviours); behaviourAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); binding.uploadFilesSpinnerBehaviour.setAdapter(behaviourAdapter); + binding.uploadFilesSpinnerBehaviour.getBackground().setColorFilter(getResources().getColor(R.color.primary, null), PorterDuff.Mode.SRC_IN); binding.uploadFilesSpinnerBehaviour.setSelection(localBehaviour); // setup the toolbar @@ -224,6 +228,7 @@ public void onCreate(Bundle savedInstanceState) { showToolbarSpinner(); mToolbarSpinner.setAdapter(mDirectories); + mToolbarSpinner.getBackground().setColorFilter(Color.TRANSPARENT, PorterDuff.Mode.SRC_IN); mToolbarSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView parent, View view, int position, long id) { diff --git a/app/src/main/res/drawable/bg_spinner.xml b/app/src/main/res/drawable/bg_spinner.xml new file mode 100644 index 000000000000..d48644569a5c --- /dev/null +++ b/app/src/main/res/drawable/bg_spinner.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/simple_spinner_item.xml b/app/src/main/res/layout/simple_spinner_item.xml new file mode 100644 index 000000000000..d4e0efd9c107 --- /dev/null +++ b/app/src/main/res/layout/simple_spinner_item.xml @@ -0,0 +1,10 @@ + + \ No newline at end of file diff --git a/app/src/main/res/layout/upload_files_layout.xml b/app/src/main/res/layout/upload_files_layout.xml index d74dc59d4f0a..cac15f7a6882 100644 --- a/app/src/main/res/layout/upload_files_layout.xml +++ b/app/src/main/res/layout/upload_files_layout.xml @@ -60,7 +60,9 @@ diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index e9c749b86943..76e4e05ca495 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -36,4 +36,68 @@ #1E1E1E @android:color/white + + + #FFFFFF + @color/grey_30 + @color/grey_30 + #CCCCCC + @color/grey_70 + @color/grey_80 + #2D2D2D + @color/grey_70 + @color/grey_70 + + + @color/grey_80 + @color/grey_0 + + + @color/grey_80 + @color/grey_0 + + + @color/grey_60 + @color/grey_0 + @color/grey_0 + @color/grey_30 + #FFFFFF + @color/grey_30 + @color/grey_80 + #FFFFFF + + + @color/grey_80 + @color/grey_30 + @color/grey_0 + + + @color/grey_80 + @color/grey_0 + @color/grey_80 + + + @color/grey_70 + @color/grey_60 + + + @color/grey_70 + @color/grey_70 + + + #FFFFFF + @color/grey_30 + @color/grey_0 + @color/grey_0 + @color/grey_0 + @color/grey_0 + @color/grey_60 + @color/grey_0 + #FFFFFF + + + #121212 + @color/grey_0 + @color/grey_80 + @color/grey_80 diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 9a721eb3e385..248aa18d524c 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -76,4 +76,93 @@ @android:color/white #666666 #A5A5A5 + + + #191919 + @color/primary + #191919 + #191919 + @color/grey_30 + @android:color/white + #FFFFFF + @color/grey_0 + #CCCCCC + #77c4ff + #B3FFFFFF + @color/grey_10 + + + #101010 + #F2F2F2 + #E5E5E5 + #B2B2B2 + #666666 + #4C4C4C + #333333 + + + @color/design_snackbar_background_color + @color/white + + + #FFFFFF + #191919 + + + @color/grey_0 + #191919 + @color/primary + #191919 + @color/primary + @color/grey_30 + @color/white + #191919 + + + #FFFFFF + #191919 + #191919 + + + #FFFFFF + #191919 + #FFFFFF + + + @color/primary + #F399C7 + #FFFFFF + @color/grey_30 + @color/grey_10 + @color/grey_0 + + + @color/primary + @color/grey_30 + @color/grey_30 + #CCCCCC + + + #191919 + @color/grey_30 + #191919 + #191919 + #191919 + #191919 + @color/grey_30 + #191919 + #000000 + #191919 + #F6E5EB + #C16F81 + #0D39DF + #0099ff + + + @color/grey_0 + #191919 + @color/grey_0 + @color/grey_30 + #77b6bb + #5077b6bb diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 1a8b501ee4b7..5182571f7e73 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -437,6 +437,10 @@ @null +