Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/320313
Change subject: Hygiene: add layout prefixes to description IDs ...................................................................... Hygiene: add layout prefixes to description IDs Add view_ / fragment_ layout prefixes to description IDs and remove an unnecessary View parent in DescriptionEditFragment Bug: T148203 Change-Id: I54db1df44458ff3fa7716860a61d1ea1468f0ac0 --- M app/src/main/java/org/wikipedia/descriptions/DescriptionEditFragment.java M app/src/main/java/org/wikipedia/descriptions/DescriptionEditView.java M app/src/main/res/layout/fragment_description_edit.xml M app/src/main/res/layout/view_description_edit.xml 4 files changed, 18 insertions(+), 24 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/13/320313/1 diff --git a/app/src/main/java/org/wikipedia/descriptions/DescriptionEditFragment.java b/app/src/main/java/org/wikipedia/descriptions/DescriptionEditFragment.java index 81b3ac6..494f93d 100644 --- a/app/src/main/java/org/wikipedia/descriptions/DescriptionEditFragment.java +++ b/app/src/main/java/org/wikipedia/descriptions/DescriptionEditFragment.java @@ -25,7 +25,7 @@ public class DescriptionEditFragment extends Fragment { private static final String ARG_TITLE = "title"; - @BindView(R.id.description_edit_view) DescriptionEditView editView; + @BindView(R.id.fragment_description_edit_view) DescriptionEditView editView; private Unbinder unbinder; private PageTitle pageTitle; @Nullable private Call<DescriptionEdit> call; diff --git a/app/src/main/java/org/wikipedia/descriptions/DescriptionEditView.java b/app/src/main/java/org/wikipedia/descriptions/DescriptionEditView.java index 0fcbbef..5fa6dee 100644 --- a/app/src/main/java/org/wikipedia/descriptions/DescriptionEditView.java +++ b/app/src/main/java/org/wikipedia/descriptions/DescriptionEditView.java @@ -28,11 +28,11 @@ import butterknife.OnTextChanged; public class DescriptionEditView extends FrameLayout { - @BindView(R.id.description_edit_page_title) TextView pageTitleText; - @BindView(R.id.description_edit_save_button) FloatingActionButton saveButton; - @BindView(R.id.description_edit_text) EditText pageDescriptionText; - @BindView(R.id.description_edit_char_count) TextView charCountText; - @BindView(R.id.description_edit_progress_bar) ProgressBar progressBar; + @BindView(R.id.view_description_edit_page_title) TextView pageTitleText; + @BindView(R.id.view_description_edit_save_button) FloatingActionButton saveButton; + @BindView(R.id.view_description_edit_text) EditText pageDescriptionText; + @BindView(R.id.view_description_edit_char_count) TextView charCountText; + @BindView(R.id.view_description_edit_progress_bar) ProgressBar progressBar; @Nullable private PageTitle pageTitle; @Nullable private String originalDescription; @@ -87,13 +87,13 @@ return pageDescriptionText.getText().toString(); } - @OnClick(R.id.description_edit_save_button) void onSaveClick() { + @OnClick(R.id.view_description_edit_save_button) void onSaveClick() { if (callback != null) { callback.onSaveClick(); } } - @OnTextChanged(value = R.id.description_edit_text, + @OnTextChanged(value = R.id.view_description_edit_text, callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED) void pageDescriptionTextChanged() { updateSaveButtonVisible(); diff --git a/app/src/main/res/layout/fragment_description_edit.xml b/app/src/main/res/layout/fragment_description_edit.xml index fc1c5ee..68022ce 100644 --- a/app/src/main/res/layout/fragment_description_edit.xml +++ b/app/src/main/res/layout/fragment_description_edit.xml @@ -1,13 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> -<FrameLayout +<org.wikipedia.descriptions.DescriptionEditView xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/fragment_description_edit_view" android:layout_width="match_parent" android:layout_height="match_parent" - android:paddingTop="?attr/actionBarSize"> - - <org.wikipedia.descriptions.DescriptionEditView - android:id="@+id/description_edit_view" - android:layout_width="match_parent" - android:layout_height="match_parent" /> - -</FrameLayout> \ No newline at end of file + android:layout_marginTop="?attr/actionBarSize" /> \ No newline at end of file diff --git a/app/src/main/res/layout/view_description_edit.xml b/app/src/main/res/layout/view_description_edit.xml index 4e1615e..4662f97 100644 --- a/app/src/main/res/layout/view_description_edit.xml +++ b/app/src/main/res/layout/view_description_edit.xml @@ -19,7 +19,7 @@ android:elevation="6dp"> <LinearLayout - android:id="@+id/description_edit_header_container" + android:id="@+id/view_description_edit_header_container" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" @@ -36,7 +36,7 @@ android:textAllCaps="true"/> <TextView - android:id="@+id/description_edit_page_title" + android:id="@+id/view_description_edit_page_title" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="4dp" @@ -50,7 +50,7 @@ </LinearLayout> <ProgressBar - android:id="@+id/description_edit_progress_bar" + android:id="@+id/view_description_edit_progress_bar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" @@ -65,7 +65,7 @@ </FrameLayout> <org.wikipedia.views.PlainPasteEditText - android:id="@+id/description_edit_text" + android:id="@+id/view_description_edit_text" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="28dp" @@ -74,7 +74,7 @@ android:hint="@string/description_edit_text_hint"/> <TextView - android:id="@+id/description_edit_char_count" + android:id="@+id/view_description_edit_char_count" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="4dp" @@ -86,7 +86,7 @@ </LinearLayout> <android.support.design.widget.FloatingActionButton - android:id="@+id/description_edit_save_button" + android:id="@+id/view_description_edit_save_button" style="@style/FloatingActionButton" android:layout_width="wrap_content" android:layout_height="wrap_content" @@ -99,7 +99,7 @@ app:elevation="6dp" app:borderWidth="0dp" app:backgroundTint="@android:color/white" - app:layout_anchor="@id/description_edit_header_container" + app:layout_anchor="@id/view_description_edit_header_container" app:layout_anchorGravity="bottom|right|end" tools:visibility="visible"/> -- To view, visit https://gerrit.wikimedia.org/r/320313 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I54db1df44458ff3fa7716860a61d1ea1468f0ac0 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Niedzielski <sniedziel...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits