Skip to content

Commit

Permalink
Change naming convention of resources
Browse files Browse the repository at this point in the history
  • Loading branch information
petrnohejl committed Jun 30, 2018
1 parent 3200853 commit a445aa1
Show file tree
Hide file tree
Showing 69 changed files with 148 additions and 148 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private void setupImageLoader()
private void setupView()
{
// reference
ImageView photoImageView = mRootView.findViewById(R.id.fragment_example_photo);
ImageView photoImageView = mRootView.findViewById(R.id.example_photo);

// image caching
mImageLoader.displayImage("http://placehold.it/200x200/ccc/4a4&text=hello", photoImageView, mDisplayImageOptions, mImageLoadingListener);
Expand Down
16 changes: 8 additions & 8 deletions Res-Menu/menu/activity_example.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@
xmlns:app="http://schemas.android.com/apk/res-auto">

<item
android:id="@+id/menu_activity_example_refresh"
android:title="@string/menu_activity_example_refresh"
android:id="@+id/menu_example_refresh"
android:title="@string/menu_example_refresh"
android:icon="@drawable/ic_menu_refresh"
android:orderInCategory="1"
app:showAsAction="ifRoom" />

<item
android:id="@+id/menu_activity_example_list"
android:title="@string/menu_activity_example_list"
android:id="@+id/menu_example_list"
android:title="@string/menu_example_list"
android:icon="@drawable/ic_menu_list"
android:orderInCategory="2"
app:showAsAction="ifRoom">
<menu>
<item
android:id="@+id/menu_activity_example_list_expand"
android:title="@string/menu_activity_example_list_expand"
android:id="@+id/menu_example_list_expand"
android:title="@string/menu_example_list_expand"
android:icon="@null"
android:orderInCategory="1" />
<item
android:id="@+id/menu_activity_example_list_collapse"
android:title="@string/menu_activity_example_list_collapse"
android:id="@+id/menu_example_list_collapse"
android:title="@string/menu_example_list_collapse"
android:icon="@null"
android:orderInCategory="2" />
</menu>
Expand Down
8 changes: 4 additions & 4 deletions Res-Plurals/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<resources>

<!-- Solution using MessageFormat -->
<!-- Usage: MessageFormat.format(getString(R.string.fragment_example_basket), quantity) -->
<string name="fragment_example_basket">{0,choice,0#Basket is empty|1#{0} item|1&lt;{0} items}</string>
<!-- Usage: MessageFormat.format(getString(R.string.example_basket), quantity) -->
<string name="example_basket">{0,choice,0#Basket is empty|1#{0} item|1&lt;{0} items}</string>

<!-- Solution using getQuantityString() -->
<!-- Usage: getQuantityString(R.plurals.fragment_example_score, quantity, quantity) -->
<!-- Usage: getQuantityString(R.plurals.example_score, quantity, quantity) -->
<!-- Czech: one, few, other -->
<!-- English: one, other -->
<plurals name="fragment_example_score">
<plurals name="example_score">
<item quantity="one">Máš jeden bod</item>
<item quantity="few">Máš %1$d body</item>
<item quantity="other">Máš %1$d bodů</item>
Expand Down
4 changes: 2 additions & 2 deletions Res-Strings/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<string name="placeholder_empty">No data</string>
<string name="placeholder_offline">No network</string>

<string name="fragment_example_title">Example fragment title</string>

<string name="dialog_example_title">Example dialog title</string>

<string name="notification_example_title">Example notification title</string>

<string name="example_title">Example fragment title</string>
</resources>
4 changes: 2 additions & 2 deletions Src-ActionBar-Refresh/java/fragment/ExampleFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
// TODO

// reference to refresh menu item
mRefreshMenuItem = menu.findItem(R.id.menu_fragment_example_refresh);
mRefreshMenuItem = menu.findItem(R.id.menu_example_refresh);

// progress in action bar
showProgress(isProgress());
Expand All @@ -52,7 +52,7 @@ public boolean onOptionsItemSelected(MenuItem item)
{
// TODO

case R.id.menu_fragment_example_refresh:
case R.id.menu_example_refresh:
refreshData();
return true;

Expand Down
4 changes: 2 additions & 2 deletions Src-ActionBar-Search/java/activity/ExampleActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public boolean onCreateOptionsMenu(Menu menu)
setupSearchView(mSearchView);

// search menu item
MenuItem searchMenuItem = menu.add(Menu.NONE, Menu.NONE, 1, R.string.menu_activity_example_search);
MenuItem searchMenuItem = menu.add(Menu.NONE, Menu.NONE, 1, R.string.menu_example_search);
searchMenuItem.setIcon(R.drawable.ic_menu_search);
MenuItemCompat.setActionView(searchMenuItem, mSearchView);
MenuItemCompat.setShowAsAction(searchMenuItem, MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);
Expand All @@ -61,7 +61,7 @@ public boolean onCreateOptionsMenu(Menu menu)
private void setupSearchView(SearchView searchView)
{
// search hint
searchView.setQueryHint(getString(R.string.menu_activity_example_search_hint));
searchView.setQueryHint(getString(R.string.menu_example_search_hint));

// text color
AutoCompleteTextView searchText = searchView.findViewById(android.support.v7.appcompat.R.id.search_src_text);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public boolean onOptionsItemSelected(MenuItem item)
// action bar menu behavior
switch(item.getItemId())
{
case R.id.menu_activity_transition_first_second:
case R.id.menu_transition_first_second:
Intent intent = TransitionSecondActivity.newIntent(this);
startActivity(intent);
overridePendingTransition(R.anim.push_left_enter, R.anim.push_left_exit);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public boolean onOptionsItemSelected(MenuItem item)
// action bar menu behavior
switch(item.getItemId())
{
case R.id.menu_activity_transition_second_first:
case R.id.menu_transition_second_first:
Intent intent = TransitionFirstActivity.newIntent(this);
startActivity(intent);
overridePendingTransition(R.anim.push_right_enter, R.anim.push_right_exit);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private void setupBottomSheet()
{
// reference
final FloatingActionButton fab = mRootView.findViewById(R.id.fab);
final View bottomSheet = mRootView.findViewById(R.id.fragment_bottom_sheet);
final View bottomSheet = mRootView.findViewById(R.id.bottom_sheet);

// fab
fab.setOnClickListener(new View.OnClickListener()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fragment_app_bar_enter_text" />
android:text="@string/app_bar_enter_text" />

</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
2 changes: 1 addition & 1 deletion Src-CoordinatorLayout/res/layout/fragment_app_bar_exit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fragment_app_bar_exit_text" />
android:text="@string/app_bar_exit_text" />

</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
8 changes: 4 additions & 4 deletions Src-CoordinatorLayout/res/layout/fragment_bottom_sheet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fragment_bottom_sheet_text" />
android:text="@string/bottom_sheet_text" />

</android.support.v4.widget.NestedScrollView>

<FrameLayout
android:id="@+id/fragment_bottom_sheet"
android:id="@+id/bottom_sheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/global_color_accent"
Expand All @@ -30,7 +30,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fragment_bottom_sheet_text" />
android:text="@string/bottom_sheet_text" />

</FrameLayout>

Expand All @@ -40,7 +40,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/global_keyline_16"
android:src="@drawable/ic_fab_search"
app:layout_anchor="@id/fragment_bottom_sheet"
app:layout_anchor="@id/bottom_sheet"
app:layout_anchorGravity="top|right|end" />

</android.support.design.widget.CoordinatorLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="@dimen/fragment_collapsing_toolbar_appbar_height"
android:layout_height="@dimen/collapsing_toolbar_appbar_height"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:fitsSystemWindows="true">

Expand Down Expand Up @@ -50,7 +50,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fragment_collapsing_toolbar_text" />
android:text="@string/collapsing_toolbar_text" />

</android.support.v4.widget.NestedScrollView>

Expand Down
10 changes: 5 additions & 5 deletions Src-CoordinatorLayout/res/layout/fragment_overlap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="@dimen/fragment_overlap_appbar_height"
android:layout_height="@dimen/overlap_appbar_height"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:expandedTitleMarginBottom="@dimen/global_spacing_72"
app:expandedTitleTextAppearance="@style/TextAppearance.AppCompat.Display1"
Expand All @@ -25,7 +25,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:tint="@color/fragment_overlap_appbar_image_tint"
android:tint="@color/overlap_appbar_image_tint"
android:src="@drawable/photo" />

<android.support.v7.widget.Toolbar
Expand All @@ -49,7 +49,7 @@
android:orientation="vertical">

<android.support.v7.widget.CardView
android:id="@+id/fragment_overlap_cardview"
android:id="@+id/overlap_cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/global_spacing_8"
Expand All @@ -61,7 +61,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fragment_overlap_text" />
android:text="@string/overlap_text" />

</android.support.v7.widget.CardView>
</LinearLayout>
Expand All @@ -74,7 +74,7 @@
android:layout_marginRight="@dimen/global_keyline_32"
android:elevation="@dimen/global_elevation_8"
android:src="@drawable/ic_fab_search"
app:layout_anchor="@id/fragment_overlap_cardview"
app:layout_anchor="@id/overlap_cardview"
app:layout_anchorGravity="top|right|end" />

</android.support.design.widget.CoordinatorLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fragment_quick_return_footer_text" />
android:text="@string/quick_return_footer_text" />

</android.support.v4.widget.NestedScrollView>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fragment_quick_return_toolbar_fab_text" />
android:text="@string/quick_return_toolbar_fab_text" />

</android.support.v4.widget.NestedScrollView>

Expand Down
6 changes: 3 additions & 3 deletions Src-CoordinatorLayout/res/layout/fragment_wide_toolbar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="@dimen/fragment_wide_toolbar_appbar_height"
android:layout_height="@dimen/wide_toolbar_appbar_height"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

<android.support.design.widget.CollapsingToolbarLayout
Expand Down Expand Up @@ -39,14 +39,14 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/global_spacing_56"
android:paddingBottom="@dimen/global_spacing_56"
android:text="@string/fragment_wide_toolbar_text" />
android:text="@string/wide_toolbar_text" />

</android.support.v4.widget.NestedScrollView>

<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/fragment_wide_toolbar_toolbar_height"
android:layout_height="@dimen/wide_toolbar_toolbar_height"
android:elevation="@dimen/global_elevation_4"
app:layout_collapseMode="pin"
app:layout_anchor="@id/appbar"
Expand Down
18 changes: 9 additions & 9 deletions Src-DialogFragment/java/fragment/ExampleFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,15 @@ public void onSheetDialogDismiss(final DialogFragment dialog, final String usern
private void setupView()
{
// reference
Button button1 = mRootView.findViewById(R.id.fragment_example_button1);
Button button2 = mRootView.findViewById(R.id.fragment_example_button2);
Button button3 = mRootView.findViewById(R.id.fragment_example_button3);
Button button4 = mRootView.findViewById(R.id.fragment_example_button4);
Button button5 = mRootView.findViewById(R.id.fragment_example_button5);
Button button6 = mRootView.findViewById(R.id.fragment_example_button6);
Button button7 = mRootView.findViewById(R.id.fragment_example_button7);
Button button8 = mRootView.findViewById(R.id.fragment_example_button8);
Button button9 = mRootView.findViewById(R.id.fragment_example_button9);
Button button1 = mRootView.findViewById(R.id.example_button1);
Button button2 = mRootView.findViewById(R.id.example_button2);
Button button3 = mRootView.findViewById(R.id.example_button3);
Button button4 = mRootView.findViewById(R.id.example_button4);
Button button5 = mRootView.findViewById(R.id.example_button5);
Button button6 = mRootView.findViewById(R.id.example_button6);
Button button7 = mRootView.findViewById(R.id.example_button7);
Button button8 = mRootView.findViewById(R.id.example_button8);
Button button9 = mRootView.findViewById(R.id.example_button9);

// content
button1.setOnClickListener(new OnClickListener()
Expand Down
2 changes: 1 addition & 1 deletion Src-Dual-Pane/java/fragment/SimpleFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private void handleExtras(Bundle extras)
private void setupView()
{
// reference
TextView nameTextView = mRootView.findViewById(R.id.fragment_simple_name);
TextView nameTextView = mRootView.findViewById(R.id.simple_name);

// content
nameTextView.setText(Integer.toString(mId));
Expand Down
2 changes: 1 addition & 1 deletion Src-HTML-TextView/java/fragment/ExampleFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
private void setupView()
{
// reference
TextView descriptionTextView = mRootView.findViewById(R.id.fragment_example_description);
TextView descriptionTextView = mRootView.findViewById(R.id.example_description);

// color highlight
String colorHighlight = toHtmlColor(R.color.global_text_secondary);
Expand Down
2 changes: 1 addition & 1 deletion Src-MVC-Activity/java/activity/ExampleActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public boolean onOptionsItemSelected(MenuItem item)
startActivity(intent);
return true;

case R.id.menu_activity_example_refresh:
case R.id.menu_example_refresh:
// TODO
return true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public View getChildView(int groupPosition, int childPosition, boolean isLastChi

// view holder
ViewHolder holder = new ViewHolder();
holder.nameTextView = convertView.findViewById(R.id.fragment_expandable_listing_item_name);
holder.nameTextView = convertView.findViewById(R.id.expandable_listing_item_name);
convertView.setTag(holder);
}

Expand Down Expand Up @@ -104,7 +104,7 @@ public View getGroupView(int groupPosition, boolean isExpanded, View convertView

// view holder
ViewHolderGroup holder = new ViewHolderGroup();
holder.nameTextView = convertView.findViewById(R.id.fragment_expandable_listing_group_name);
holder.nameTextView = convertView.findViewById(R.id.expandable_listing_group_name);
convertView.setTag(holder);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<org.alfonz.view.StatefulLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/fragment_expandable_listing_stateful_layout"
android:id="@+id/expandable_listing_stateful_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:background="@color/global_bg_back">

<TextView
android:id="@+id/fragment_expandable_listing_group_name"
android:id="@+id/expandable_listing_group_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/global_keyline_32"
Expand Down
Loading

0 comments on commit a445aa1

Please sign in to comment.