Browse Source

polish template chooser dialog

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 4 năm trước cách đây
mục cha
commit
46da2040ae

+ 10 - 12
src/main/java/com/owncloud/android/ui/adapter/RichDocumentsTemplateAdapter.java

@@ -33,6 +33,7 @@ import com.bumptech.glide.Glide;
 import com.nextcloud.client.account.CurrentAccountProvider;
 import com.nextcloud.client.network.ClientFactory;
 import com.owncloud.android.R;
+import com.owncloud.android.databinding.TemplateButtonBinding;
 import com.owncloud.android.datamodel.Template;
 import com.owncloud.android.ui.dialog.ChooseRichDocumentsTemplateDialogFragment;
 import com.owncloud.android.utils.NextcloudServer;
@@ -76,7 +77,9 @@ public class RichDocumentsTemplateAdapter extends RecyclerView.Adapter<RichDocum
     @Override
     @NextcloudServer(max = 18) // remove entire class
     public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
-        return new ViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.template_button, parent, false));
+        return new RichDocumentsTemplateAdapter.ViewHolder(TemplateButtonBinding.inflate(LayoutInflater.from(parent.getContext()),
+                                                                            parent,
+                                                                            false));
     }
 
     @Override
@@ -95,17 +98,12 @@ public class RichDocumentsTemplateAdapter extends RecyclerView.Adapter<RichDocum
 
     public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
 
-        @BindView(R.id.name)
-        public TextView name;
-
-        @BindView(R.id.thumbnail)
-        public ImageView thumbnail;
-
+        private final TemplateButtonBinding binding;
         private Template template;
 
-        public ViewHolder(View itemView) {
-            super(itemView);
-            ButterKnife.bind(this, itemView);
+        public ViewHolder(@NonNull TemplateButtonBinding binding) {
+            super(binding.getRoot());
+            this.binding = binding;
             itemView.setOnClickListener(this);
         }
 
@@ -143,9 +141,9 @@ public class RichDocumentsTemplateAdapter extends RecyclerView.Adapter<RichDocum
                 load(template.getThumbnailLink())
                 .placeholder(placeholder)
                 .error(placeholder)
-                .into(thumbnail);
+                .into(binding.template);
 
-            name.setText(template.getName());
+            binding.templateName.setText(template.getName());
         }
     }
 

+ 18 - 13
src/main/java/com/owncloud/android/ui/adapter/TemplateAdapter.java

@@ -36,9 +36,12 @@ import com.bumptech.glide.Glide;
 import com.nextcloud.client.account.CurrentAccountProvider;
 import com.nextcloud.client.network.ClientFactory;
 import com.owncloud.android.R;
+import com.owncloud.android.databinding.SendButtonBinding;
+import com.owncloud.android.databinding.TemplateButtonBinding;
 import com.owncloud.android.lib.common.Template;
 import com.owncloud.android.lib.common.TemplateList;
 import com.owncloud.android.utils.MimeTypeUtil;
+import com.owncloud.android.utils.ThemeUtils;
 import com.owncloud.android.utils.glide.CustomGlideStreamLoader;
 
 import androidx.annotation.NonNull;
@@ -58,6 +61,8 @@ public class TemplateAdapter extends RecyclerView.Adapter<TemplateAdapter.ViewHo
     private ClientFactory clientFactory;
     private String mimetype;
     private Template selectedTemplate;
+    private final int colorSelected;
+    private final int colorUnselected;
 
     public TemplateAdapter(
         String mimetype,
@@ -71,12 +76,16 @@ public class TemplateAdapter extends RecyclerView.Adapter<TemplateAdapter.ViewHo
         this.context = context;
         this.currentAccountProvider = currentAccountProvider;
         this.clientFactory = clientFactory;
+        colorSelected = ThemeUtils.primaryColor(context, true);
+        colorUnselected = context.getResources().getColor(R.color.grey_200);
     }
 
     @NonNull
     @Override
     public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
-        return new ViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.template_button, parent, false));
+        return new TemplateAdapter.ViewHolder(TemplateButtonBinding.inflate(LayoutInflater.from(parent.getContext()),
+                                                                            parent,
+                                                                            false));
     }
 
     @Override
@@ -103,17 +112,13 @@ public class TemplateAdapter extends RecyclerView.Adapter<TemplateAdapter.ViewHo
     }
 
     public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
-        @BindView(R.id.name)
-        public TextView name;
-
-        @BindView(R.id.thumbnail)
-        public ImageView thumbnail;
 
+        private final TemplateButtonBinding binding;
         private Template template;
 
-        public ViewHolder(View itemView) {
-            super(itemView);
-            ButterKnife.bind(this, itemView);
+        public ViewHolder(@NonNull TemplateButtonBinding binding) {
+            super(binding.getRoot());
+            this.binding = binding;
             itemView.setOnClickListener(this);
         }
 
@@ -136,14 +141,14 @@ public class TemplateAdapter extends RecyclerView.Adapter<TemplateAdapter.ViewHo
                 .load(template.getPreview())
                 .placeholder(placeholder)
                 .error(placeholder)
-                .into(thumbnail);
+                .into(binding.template);
 
-            name.setText(template.getTitle());
+            binding.templateName.setText(template.getTitle());
 
             if (template == selectedTemplate) {
-                thumbnail.setBackgroundColor(context.getResources().getColor(R.color.hwSecurityRed));
+                binding.templateContainer.setStrokeColor(colorSelected);
             } else {
-                thumbnail.setBackgroundColor(context.getResources().getColor(R.color.transparent));
+                binding.templateContainer.setStrokeColor(colorUnselected);
             }
         }
     }

+ 21 - 27
src/main/java/com/owncloud/android/ui/dialog/ChooseRichDocumentsTemplateDialogFragment.java

@@ -22,19 +22,16 @@
 
 package com.owncloud.android.ui.dialog;
 
-import android.annotation.SuppressLint;
 import android.app.Activity;
 import android.app.Dialog;
 import android.content.DialogInterface;
 import android.content.Intent;
-import android.graphics.PorterDuff;
 import android.os.AsyncTask;
 import android.os.Bundle;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.Window;
 import android.view.WindowManager.LayoutParams;
-import android.widget.EditText;
 
 import com.nextcloud.client.account.CurrentAccountProvider;
 import com.nextcloud.client.account.User;
@@ -42,6 +39,7 @@ import com.nextcloud.client.di.Injectable;
 import com.nextcloud.client.network.ClientFactory;
 import com.owncloud.android.MainApp;
 import com.owncloud.android.R;
+import com.owncloud.android.databinding.ChooseTemplateBinding;
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
 import com.owncloud.android.datamodel.Template;
@@ -72,9 +70,6 @@ import androidx.annotation.NonNull;
 import androidx.appcompat.app.AlertDialog;
 import androidx.fragment.app.DialogFragment;
 import androidx.recyclerview.widget.GridLayoutManager;
-import androidx.recyclerview.widget.RecyclerView;
-import butterknife.BindView;
-import butterknife.ButterKnife;
 
 /**
  * Dialog to show templates for new documents/spreadsheets/presentations.
@@ -99,11 +94,7 @@ public class ChooseRichDocumentsTemplateDialogFragment extends DialogFragment im
         PRESENTATION
     }
 
-    @BindView(R.id.list)
-    RecyclerView listView;
-
-    @BindView(R.id.filename)
-    EditText fileName;
+    ChooseTemplateBinding binding;
 
     @NextcloudServer(max = 18) // will be removed in favor of generic direct editing
     public static ChooseRichDocumentsTemplateDialogFragment newInstance(OCFile parentFolder, Type type) {
@@ -113,7 +104,6 @@ public class ChooseRichDocumentsTemplateDialogFragment extends DialogFragment im
         args.putString(ARG_TYPE, type.name());
         frag.setArguments(args);
         return frag;
-
     }
 
     @Override
@@ -141,17 +131,15 @@ public class ChooseRichDocumentsTemplateDialogFragment extends DialogFragment im
             throw new IllegalArgumentException("Activity may not be null");
         }
 
-        int accentColor = ThemeUtils.primaryAccentColor(getContext());
-
         parentFolder = arguments.getParcelable(ARG_PARENT_FOLDER);
 
         // Inflate the layout for the dialog
-        LayoutInflater inflater = activity.getLayoutInflater();
-        @SuppressLint("InflateParams") View view = inflater.inflate(R.layout.choose_template, null);
-        ButterKnife.bind(this, view);
+        LayoutInflater inflater = requireActivity().getLayoutInflater();
+        binding = ChooseTemplateBinding.inflate(inflater, null, false);
+        View view = binding.getRoot();
 
-        fileName.requestFocus();
-        fileName.getBackground().setColorFilter(accentColor, PorterDuff.Mode.SRC_ATOP);
+        binding.filename.requestFocus();
+        ThemeUtils.colorTextInputLayout(binding.filenameContainer, ThemeUtils.primaryColor(getContext()));
 
         try {
             client = clientFactory.create(currentAccount.getUser());
@@ -162,10 +150,10 @@ public class ChooseRichDocumentsTemplateDialogFragment extends DialogFragment im
         Type type = Type.valueOf(arguments.getString(ARG_TYPE));
         new FetchTemplateTask(this, client).execute(type);
 
-        listView.setHasFixedSize(true);
-        listView.setLayoutManager(new GridLayoutManager(activity, 2));
+        binding.list.setHasFixedSize(true);
+        binding.list.setLayoutManager(new GridLayoutManager(activity, 2));
         adapter = new RichDocumentsTemplateAdapter(type, this, getContext(), currentAccount, clientFactory);
-        listView.setAdapter(adapter);
+        binding.list.setAdapter(adapter);
 
         // Build the dialog
         AlertDialog.Builder builder = new AlertDialog.Builder(activity);
@@ -183,6 +171,12 @@ public class ChooseRichDocumentsTemplateDialogFragment extends DialogFragment im
         return dialog;
     }
 
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+        binding = null;
+    }
+
     private void createFromTemplate(Template template, String path) {
         new CreateFileFromTemplateTask(this, client, template, path, currentAccount.getUser()).execute();
     }
@@ -194,11 +188,11 @@ public class ChooseRichDocumentsTemplateDialogFragment extends DialogFragment im
 
     @Override
     public void onClick(Template template) {
-        String name = fileName.getText().toString();
+        String name = binding.filename.getText().toString();
         String path = parentFolder.getRemotePath() + name;
 
         if (name.isEmpty() || name.equalsIgnoreCase(DOT + template.getExtension())) {
-            DisplayUtils.showSnackMessage(listView, R.string.enter_filename);
+            DisplayUtils.showSnackMessage(binding.list, R.string.enter_filename);
         } else if (!name.endsWith(template.getExtension())) {
             createFromTemplate(template, path + DOT + template.getExtension());
         } else {
@@ -268,7 +262,7 @@ public class ChooseRichDocumentsTemplateDialogFragment extends DialogFragment im
 
             if (fragment != null && fragment.isAdded()) {
                 if (url.isEmpty()) {
-                    DisplayUtils.showSnackMessage(fragment.listView, "Error creating file from template");
+                    DisplayUtils.showSnackMessage(fragment.binding.list, "Error creating file from template");
                 } else {
                     Intent collaboraWebViewIntent = new Intent(MainApp.getAppContext(), RichDocumentsEditorWebView.class);
                     collaboraWebViewIntent.putExtra(ExternalSiteWebView.EXTRA_TITLE, "Collabora");
@@ -319,12 +313,12 @@ public class ChooseRichDocumentsTemplateDialogFragment extends DialogFragment im
 
             if (fragment != null) {
                 if (templateList.isEmpty()) {
-                    DisplayUtils.showSnackMessage(fragment.listView, R.string.error_retrieving_templates);
+                    DisplayUtils.showSnackMessage(fragment.binding.list, R.string.error_retrieving_templates);
                 } else {
                     fragment.setTemplateList(templateList);
 
                     String name = DOT + templateList.get(0).getExtension();
-                    fragment.fileName.setText(name);
+                    fragment.binding.filename.setText(name);
                 }
             } else {
                 Log_OC.e(TAG, "Error streaming file: no previewMediaFragment!");

+ 24 - 28
src/main/java/com/owncloud/android/ui/dialog/ChooseTemplateDialogFragment.java

@@ -24,12 +24,10 @@
 
 package com.owncloud.android.ui.dialog;
 
-import android.annotation.SuppressLint;
 import android.app.Activity;
 import android.app.Dialog;
 import android.content.Context;
 import android.content.Intent;
-import android.graphics.PorterDuff;
 import android.os.AsyncTask;
 import android.os.Bundle;
 import android.util.ArrayMap;
@@ -38,7 +36,6 @@ import android.view.View;
 import android.view.Window;
 import android.view.WindowManager.LayoutParams;
 import android.widget.Button;
-import android.widget.EditText;
 
 import com.nextcloud.android.lib.resources.directediting.DirectEditingCreateFileRemoteOperation;
 import com.nextcloud.android.lib.resources.directediting.DirectEditingObtainListOfTemplatesRemoteOperation;
@@ -48,6 +45,7 @@ import com.nextcloud.client.di.Injectable;
 import com.nextcloud.client.network.ClientFactory;
 import com.owncloud.android.MainApp;
 import com.owncloud.android.R;
+import com.owncloud.android.databinding.ChooseTemplateBinding;
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
 import com.owncloud.android.lib.common.Creator;
@@ -66,6 +64,7 @@ import com.owncloud.android.utils.FileStorageUtils;
 import com.owncloud.android.utils.ThemeUtils;
 
 import java.lang.ref.WeakReference;
+import java.util.Map;
 
 import javax.inject.Inject;
 
@@ -73,9 +72,6 @@ import androidx.annotation.NonNull;
 import androidx.appcompat.app.AlertDialog;
 import androidx.fragment.app.DialogFragment;
 import androidx.recyclerview.widget.GridLayoutManager;
-import androidx.recyclerview.widget.RecyclerView;
-import butterknife.BindView;
-import butterknife.ButterKnife;
 
 /**
  * Dialog to show templates for new documents/spreadsheets/presentations.
@@ -100,11 +96,7 @@ public class ChooseTemplateDialogFragment extends DialogFragment implements View
         PRESENTATION
     }
 
-    @BindView(R.id.list)
-    RecyclerView listView;
-
-    @BindView(R.id.filename)
-    EditText fileName;
+    ChooseTemplateBinding binding;
 
     public static ChooseTemplateDialogFragment newInstance(OCFile parentFolder, Creator creator) {
         ChooseTemplateDialogFragment frag = new ChooseTemplateDialogFragment();
@@ -144,18 +136,16 @@ public class ChooseTemplateDialogFragment extends DialogFragment implements View
             throw new IllegalArgumentException("Activity may not be null");
         }
 
-        int accentColor = ThemeUtils.primaryAccentColor(getContext());
-
         parentFolder = arguments.getParcelable(ARG_PARENT_FOLDER);
         creator = arguments.getParcelable(ARG_CREATOR);
 
         // Inflate the layout for the dialog
-        LayoutInflater inflater = activity.getLayoutInflater();
-        @SuppressLint("InflateParams") View view = inflater.inflate(R.layout.choose_template, null);
-        ButterKnife.bind(this, view);
+        LayoutInflater inflater = requireActivity().getLayoutInflater();
+        binding = ChooseTemplateBinding.inflate(inflater, null, false);
+        View view = binding.getRoot();
 
-        fileName.requestFocus();
-        fileName.getBackground().setColorFilter(accentColor, PorterDuff.Mode.SRC_ATOP);
+        binding.filename.requestFocus();
+        ThemeUtils.colorTextInputLayout(binding.filenameContainer, ThemeUtils.primaryColor(getContext()));
 
         try {
             User user = currentAccount.getUser();
@@ -164,10 +154,10 @@ public class ChooseTemplateDialogFragment extends DialogFragment implements View
             Log_OC.e(TAG, "Loading stream url not possible: " + e);
         }
 
-        listView.setHasFixedSize(true);
-        listView.setLayoutManager(new GridLayoutManager(activity, 2));
+        binding.list.setHasFixedSize(true);
+        binding.list.setLayoutManager(new GridLayoutManager(activity, 2));
         adapter = new TemplateAdapter(creator.getMimetype(), this, getContext(), currentAccount, clientFactory);
-        listView.setAdapter(adapter);
+        binding.list.setAdapter(adapter);
 
         // Build the dialog
         AlertDialog.Builder builder = new AlertDialog.Builder(activity);
@@ -186,12 +176,18 @@ public class ChooseTemplateDialogFragment extends DialogFragment implements View
         return dialog;
     }
 
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+        binding = null;
+    }
+
     private void createFromTemplate(Template template, String path) {
         new CreateFileFromTemplateTask(this, clientFactory, currentAccount.getUser(), template, path, creator).execute();
     }
 
     public void setTemplateList(TemplateList templateList) {
-        ArrayMap<String, Template> map = new ArrayMap();
+        Map<String, Template> map = new ArrayMap<>();
 
         map.put("1", new Template("1", "txt", "Test", "null"));
         map.put("2", new Template("2", "txt", "Test", "null"));
@@ -208,15 +204,15 @@ public class ChooseTemplateDialogFragment extends DialogFragment implements View
 
     @Override
     public void onClick(View v) {
-        String name = fileName.getText().toString();
+        String name = binding.filename.getText().toString();
         String path = parentFolder.getRemotePath() + name;
 
         Template selectedTemplate = adapter.getSelectedTemplate();
 
         if (selectedTemplate == null) {
-            DisplayUtils.showSnackMessage(listView, R.string.select_one_template);
+            DisplayUtils.showSnackMessage(binding.list, R.string.select_one_template);
         } else if (name.isEmpty() || name.equalsIgnoreCase(DOT + selectedTemplate.getExtension())) {
-            DisplayUtils.showSnackMessage(listView, R.string.enter_filename);
+            DisplayUtils.showSnackMessage(binding.list, R.string.enter_filename);
         } else if (!name.endsWith(selectedTemplate.getExtension())) {
             createFromTemplate(selectedTemplate, path + DOT + selectedTemplate.getExtension());
         } else {
@@ -299,7 +295,7 @@ public class ChooseTemplateDialogFragment extends DialogFragment implements View
 
             if (fragment != null && fragment.isAdded()) {
                 if (url.isEmpty()) {
-                    DisplayUtils.showSnackMessage(fragment.listView, "Error creating file from template");
+                    DisplayUtils.showSnackMessage(fragment.binding.list, "Error creating file from template");
                 } else {
                     Intent editorWebView = new Intent(MainApp.getAppContext(), TextEditorWebView.class);
                     editorWebView.putExtra(ExternalSiteWebView.EXTRA_TITLE, "Text");
@@ -360,12 +356,12 @@ public class ChooseTemplateDialogFragment extends DialogFragment implements View
 
             if (fragment != null && fragment.isAdded()) {
                 if (templateList.templates.isEmpty()) {
-                    DisplayUtils.showSnackMessage(fragment.listView, R.string.error_retrieving_templates);
+                    DisplayUtils.showSnackMessage(fragment.binding.list, R.string.error_retrieving_templates);
                 } else {
                     fragment.setTemplateList(templateList);
 
                     String name = DOT + templateList.templates.values().iterator().next().getExtension();
-                    fragment.fileName.setText(name);
+                    fragment.binding.filename.setText(name);
                 }
             } else {
                 Log_OC.e(TAG, "Error streaming file: no previewMediaFragment!");

+ 34 - 9
src/main/res/layout/choose_template.xml

@@ -3,6 +3,8 @@
   Nextcloud Android client application
 
   @author Tobias Kaminsky
+  @author Andy Scherzinger
+  Copyright (C) 2020 Andy Scherzinger
   Copyright (C) 2018 Tobias Kaminsky
   Copyright (C) 2018 Nextcloud GmbH.
 
@@ -20,11 +22,20 @@
   along with this program. If not, see <https://www.gnu.org/licenses/>.
 -->
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-              android:layout_width="match_parent"
-              android:layout_height="match_parent"
-              android:gravity="clip_horizontal"
-              android:orientation="vertical"
-              android:padding="@dimen/standard_padding">
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:gravity="clip_horizontal"
+    android:orientation="vertical"
+    android:paddingStart="@dimen/standard_padding"
+    android:paddingEnd="@dimen/standard_padding">
+
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:paddingStart="@dimen/standard_half_padding"
+        android:paddingEnd="@dimen/standard_half_padding"
+        android:text="@string/choose_template_helper_text"
+        android:textColor="@color/secondary_text_color" />
 
     <androidx.recyclerview.widget.RecyclerView
         android:id="@+id/list"
@@ -32,11 +43,25 @@
         android:layout_height="0dp"
         android:layout_weight="1" />
 
-    <com.google.android.material.textfield.TextInputEditText
-        android:id="@+id/filename"
+    <com.google.android.material.textfield.TextInputLayout
+        android:id="@+id/filename_container"
+        style="@style/TextInputLayout"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:hint="@string/filename_hint"
-        android:inputType="text"
-        android:importantForAutofill="no" />
+        android:paddingTop="@dimen/standard_padding">
+
+        <com.google.android.material.textfield.TextInputEditText
+            android:id="@+id/filename"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:ems="10"
+            android:gravity="top"
+            android:importantForAutofill="no"
+            android:inputType="text"
+            android:scrollbars="vertical">
+
+        </com.google.android.material.textfield.TextInputEditText>
+
+    </com.google.android.material.textfield.TextInputLayout>
 </LinearLayout>

+ 28 - 16
src/main/res/layout/template_button.xml

@@ -3,6 +3,8 @@
   Nextcloud Android client application
 
   @author Tobias Kaminsky
+  @author Andy Scherzinger
+  Copyright (C) 2020 Andy Scherzinger
   Copyright (C) 2018 Tobias Kaminsky
   Copyright (C) 2018 Nextcloud GmbH.
 
@@ -19,25 +21,35 @@
   You should have received a copy of the GNU General Public License
   along with this program. If not, see <https://www.gnu.org/licenses/>.
 -->
-
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-              xmlns:tools="http://schemas.android.com/tools"
-              android:layout_width="match_parent"
-              android:layout_height="wrap_content"
-              android:orientation="vertical"
-              android:paddingTop="@dimen/standard_padding"
-              tools:ignore="UseCompoundDrawables">
-
-    <ImageView
-        android:id="@+id/thumbnail"
-        android:layout_width="@dimen/share_icon_size"
-        android:layout_height="@dimen/share_icon_size"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical"
+    android:paddingTop="@dimen/standard_padding">
+
+    <com.google.android.material.card.MaterialCardView
+        android:id="@+id/template_container"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
         android:layout_gravity="center_horizontal"
-        android:contentDescription="@string/thumbnail"
-        android:src="@drawable/file_doc"/>
+        app:cardElevation="0dp"
+        app:strokeColor="@color/grey_200"
+        app:strokeWidth="2dp">
+
+        <ImageView
+            android:id="@+id/template"
+            android:layout_width="60dp"
+            android:layout_height="84dp"
+            android:layout_margin="@dimen/standard_margin"
+            android:contentDescription="@string/thumbnail"
+            android:src="@drawable/file_doc" />
+
+    </com.google.android.material.card.MaterialCardView>
 
     <TextView
-        android:id="@+id/name"
+        android:id="@+id/template_name"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_gravity="center"
@@ -45,5 +57,5 @@
         android:gravity="center_horizontal"
         android:paddingTop="@dimen/standard_half_padding"
         android:textColor="@color/text_color"
-        tools:text="@tools:sample/lorem" />
+        tools:text="Template" />
 </LinearLayout>

+ 1 - 0
src/main/res/values/strings.xml

@@ -956,4 +956,5 @@
     <string name="brute_force_delay">Delayed due to too many wrong attempts</string>
     <string name="create">Create</string>
     <string name="select_one_template">Please select one template</string>
+    <string name="choose_template_helper_text">Please choose a template and enter a file name.</string>
 </resources>