浏览代码

changes color of the OK button and the text

Andy Scherzinger 9 年之前
父节点
当前提交
9d9bc6958b
共有 2 个文件被更改,包括 9 次插入3 次删除
  1. 1 1
      res/values/strings.xml
  2. 8 2
      src/com/owncloud/android/ui/activity/FileDisplayActivity.java

+ 1 - 1
res/values/strings.xml

@@ -407,6 +407,6 @@
     <string name="manage_space_clear_data">Clear data</string>
     <string name="manage_space_error">Some files could not be deleted.</string>
 
-    <string name="permission_storage_access">Write access is required to upload/download files.</string>
+    <string name="permission_storage_access">Additional permissions required to upload &amp; download files.</string>
 
 </resources>

+ 8 - 2
src/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@ -220,14 +220,20 @@ public class FileDisplayActivity extends HookActivity
                 // code is still in place in case this changes in the future
 
                 // Show explanation to the user and then request permission
-                Snackbar.make(findViewById(R.id.ListLayout), R.string.permission_storage_access,
+                Snackbar snackbar = Snackbar.make(findViewById(R.id.ListLayout), R.string.permission_storage_access,
                         Snackbar.LENGTH_INDEFINITE)
                         .setAction(R.string.common_ok, new View.OnClickListener() {
                             @Override
                             public void onClick(View v) {
                                 requestWriteExternalStoreagePermission();
                             }
-                        }).show();
+                        });
+
+                // Changing action button text color
+                View sbView = snackbar.getView();
+                TextView textView = (TextView) sbView.findViewById(android.support.design.R.id.snackbar_text);
+                textView.setTextColor(ContextCompat.getColor(this, R.color.white));
+                snackbar.show();
             } else {
                 // No explanation needed, request the permission.
                 requestWriteExternalStoreagePermission();