├── .gitignore
├── .idea
├── .name
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── gradle.xml
├── misc.xml
├── modules.xml
├── runConfigurations.xml
└── vcs.xml
├── NestedToolbarTutorial.iml
├── README.md
├── app
├── .gitignore
├── app-release.apk
├── app.iml
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── alexzh
│ │ └── nestedtoolbartutorial
│ │ └── ApplicationTest.java
│ └── main
│ ├── AndroidManifest.xml
│ ├── ic_launcher-web.png
│ ├── java
│ └── com
│ │ └── alexzh
│ │ └── nestedtoolbartutorial
│ │ ├── CountriesAdapter.java
│ │ ├── DetailFragment.java
│ │ ├── ListFragment.java
│ │ └── MainActivity.java
│ └── res
│ ├── drawable-hdpi
│ ├── ic_action_menu.png
│ └── ic_action_search.png
│ ├── drawable-mdpi
│ ├── ic_action_menu.png
│ └── ic_action_search.png
│ ├── drawable-xhdpi
│ ├── ic_action_menu.png
│ └── ic_action_search.png
│ ├── drawable-xxhdpi
│ ├── ic_action_menu.png
│ └── ic_action_search.png
│ ├── layout
│ ├── activity_main.xml
│ ├── drawer_header.xml
│ ├── fragment_detail.xml
│ ├── fragment_list.xml
│ └── item_card.xml
│ ├── menu
│ ├── drawer_menu.xml
│ └── menu_main.xml
│ ├── mipmap-hdpi
│ └── ic_launcher.png
│ ├── mipmap-mdpi
│ └── ic_launcher.png
│ ├── mipmap-xhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxxhdpi
│ └── ic_launcher.png
│ ├── values-land
│ └── dimens.xml
│ ├── values-sw600dp-land
│ └── dimens.xml
│ ├── values-sw600dp-port
│ └── dimens.xml
│ └── values
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 | /captures
8 |
--------------------------------------------------------------------------------
/.idea/.name:
--------------------------------------------------------------------------------
1 | NestedToolbarTutorial
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | 1.7
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/NestedToolbarTutorial.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # NestedToolbarTutorial
2 | Demo of nested toolbar in Android application
3 |
4 |
5 |
6 | Demo:
7 |
8 |
9 |
10 | You can download and try this project.
11 |
12 |
13 |
15 |
16 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/app-release.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexZhukovich/NestedToolbarTutorial/059188af2948e59026ef99c2ab6452555ee4f033/app/app-release.apk
--------------------------------------------------------------------------------
/app/app.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | generateDebugAndroidTestSources
19 | generateDebugSources
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 22
5 | buildToolsVersion "22.0.1"
6 |
7 | defaultConfig {
8 | applicationId "com.alexzh.nestedtoolbartutorial"
9 | minSdkVersion 14
10 | targetSdkVersion 22
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | compile 'com.android.support:appcompat-v7:22.2.0'
25 | compile 'com.android.support:cardview-v7:22.2.0'
26 | compile 'com.android.support:recyclerview-v7:22.2.0'
27 | compile 'com.android.support:design:22.2.0'
28 | }
29 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/alex/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/alexzh/nestedtoolbartutorial/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.alexzh.nestedtoolbartutorial;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexZhukovich/NestedToolbarTutorial/059188af2948e59026ef99c2ab6452555ee4f033/app/src/main/ic_launcher-web.png
--------------------------------------------------------------------------------
/app/src/main/java/com/alexzh/nestedtoolbartutorial/CountriesAdapter.java:
--------------------------------------------------------------------------------
1 | package com.alexzh.nestedtoolbartutorial;
2 |
3 | import android.support.v7.widget.RecyclerView;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.TextView;
8 |
9 | import java.util.List;
10 |
11 | public class CountriesAdapter extends RecyclerView.Adapter {
12 |
13 | private List mList;
14 | private View.OnClickListener mListener;
15 |
16 | public CountriesAdapter(List list, View.OnClickListener listener) {
17 | mList = list;
18 | mListener = listener;
19 | }
20 |
21 | public void setList(List list) {
22 | mList = list;
23 | notifyDataSetChanged();
24 | }
25 |
26 | @Override
27 | public CountriesAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
28 | View mView = LayoutInflater.from(parent.getContext()).inflate(
29 | R.layout.item_card,
30 | parent,
31 | false);
32 | mView.setOnClickListener(mListener);
33 | return new ViewHolder(mView);
34 | }
35 |
36 | @Override
37 | public void onBindViewHolder(ViewHolder viewHolder, int position) {
38 | viewHolder.text.setText(mList.get(position));
39 | }
40 |
41 | @Override
42 | public int getItemCount() {
43 | return mList.size();
44 | }
45 |
46 | public static class ViewHolder extends RecyclerView.ViewHolder {
47 |
48 | private TextView text;
49 |
50 | public ViewHolder(View itemView) {
51 | super(itemView);
52 | text = (TextView) itemView.findViewById(R.id.text);
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/app/src/main/java/com/alexzh/nestedtoolbartutorial/DetailFragment.java:
--------------------------------------------------------------------------------
1 | package com.alexzh.nestedtoolbartutorial;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.TextView;
10 |
11 | public class DetailFragment extends Fragment {
12 | public final static String COUNTRY = "country";
13 |
14 | public static Fragment newInstance(String country) {
15 | Fragment fragment = new DetailFragment();
16 | Bundle args = new Bundle();
17 | args.putString(COUNTRY, country);
18 | fragment.setArguments(args);
19 | return fragment;
20 | }
21 |
22 | @Nullable
23 | @Override
24 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
25 | View rootView = inflater.inflate(R.layout.fragment_detail, container, false);
26 |
27 | TextView mCountry = (TextView) rootView.findViewById(R.id.countryTextView);
28 | mCountry.setText(getArguments().getString(COUNTRY));
29 |
30 | return rootView;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/com/alexzh/nestedtoolbartutorial/ListFragment.java:
--------------------------------------------------------------------------------
1 | package com.alexzh.nestedtoolbartutorial;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.support.v4.app.Fragment;
6 | import android.support.v7.widget.DefaultItemAnimator;
7 | import android.support.v7.widget.LinearLayoutManager;
8 | import android.support.v7.widget.RecyclerView;
9 | import android.view.LayoutInflater;
10 | import android.view.View;
11 | import android.view.ViewGroup;
12 | import java.util.Arrays;
13 | import java.util.List;
14 |
15 | public class ListFragment extends Fragment implements View.OnClickListener {
16 | public final static String DETAIL = "detail";
17 |
18 | private RecyclerView mRecyclerView;
19 | private CountriesAdapter mAdapter;
20 | private List mList;
21 |
22 | public void setList(List list) {
23 | mList = list;
24 | if (mAdapter == null)
25 | mAdapter = new CountriesAdapter(mList, this);
26 | mAdapter.setList(list);
27 | mAdapter.notifyDataSetChanged();
28 | }
29 |
30 | @Override
31 | public void onCreate(@Nullable Bundle savedInstanceState) {
32 | super.onCreate(savedInstanceState);
33 | setRetainInstance(true);
34 | }
35 |
36 | @Nullable
37 | @Override
38 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
39 | View rootView = inflater.inflate(R.layout.fragment_list, container, false);
40 | if (mList == null)
41 | mList = Arrays.asList(getResources().getStringArray(R.array.countries));
42 | mAdapter = new CountriesAdapter(mList, this);
43 | mRecyclerView = (RecyclerView) rootView.findViewById(R.id.recyclerView);
44 | mRecyclerView.setHasFixedSize(true);
45 | mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
46 | mRecyclerView.setItemAnimator(new DefaultItemAnimator());
47 | mRecyclerView.setAdapter(mAdapter);
48 | return rootView;
49 | }
50 |
51 | @Override
52 | public void onClick(View v) {
53 | getActivity().getSupportFragmentManager().beginTransaction()
54 | .setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out)
55 | .replace(R.id.content_frame, DetailFragment.newInstance(mList.get(mRecyclerView.getChildAdapterPosition(v))), DETAIL)
56 | .addToBackStack(DETAIL)
57 | .commit();
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/app/src/main/java/com/alexzh/nestedtoolbartutorial/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.alexzh.nestedtoolbartutorial;
2 |
3 | import android.content.Intent;
4 | import android.net.Uri;
5 | import android.support.annotation.NonNull;
6 | import android.support.design.widget.NavigationView;
7 | import android.support.v4.view.GravityCompat;
8 | import android.support.v4.view.MenuItemCompat;
9 | import android.support.v4.widget.DrawerLayout;
10 | import android.support.v7.app.AppCompatActivity;
11 | import android.os.Bundle;
12 | import android.support.v7.widget.SearchView;
13 | import android.support.v7.widget.Toolbar;
14 | import android.view.Menu;
15 | import android.view.MenuItem;
16 | import android.view.View;
17 | import java.util.ArrayList;
18 | import java.util.Arrays;
19 | import java.util.List;
20 |
21 | public class MainActivity extends AppCompatActivity implements SearchView.OnQueryTextListener,
22 | View.OnClickListener, NavigationView.OnNavigationItemSelectedListener {
23 | private final static String SEARCH = "search";
24 |
25 | private ListFragment mListFragment;
26 | private Toolbar mNestedToolbar, mGeneralToolbar;
27 | private SearchView mSearchView;
28 | private DrawerLayout mDrawerLayout;
29 |
30 | private String searchRequest;
31 |
32 | @Override
33 | protected void onCreate(Bundle savedInstanceState) {
34 | super.onCreate(savedInstanceState);
35 | setContentView(R.layout.activity_main);
36 |
37 | mDrawerLayout = (DrawerLayout) findViewById(R.id.drawerLayout);
38 | mListFragment = new ListFragment();
39 | mNestedToolbar = (Toolbar) findViewById(R.id.nestedToolbar);
40 | mGeneralToolbar = (Toolbar) findViewById(R.id.generalToolbar);
41 | mGeneralToolbar.setNavigationIcon(R.drawable.ic_action_menu);
42 | mGeneralToolbar.setNavigationOnClickListener(this);
43 | if (getSupportFragmentManager().findFragmentByTag(ListFragment.DETAIL) == null) {
44 | getSupportFragmentManager().beginTransaction()
45 | .replace(R.id.content_frame, mListFragment)
46 | .commit();
47 | }
48 | setSupportActionBar(mNestedToolbar);
49 | getSupportActionBar().setTitle(R.string.app_name);
50 | ((NavigationView)findViewById(R.id.navigation)).setNavigationItemSelectedListener(this);
51 | }
52 |
53 | @Override
54 | public boolean onCreateOptionsMenu(Menu menu) {
55 | getMenuInflater().inflate(R.menu.menu_main, menu);
56 |
57 | MenuItem searchItem = menu.findItem(R.id.action_search);
58 | mSearchView = (SearchView) MenuItemCompat.getActionView(searchItem);
59 | mSearchView.setOnQueryTextListener(this);
60 | if (searchRequest != null)
61 | mSearchView.setQuery(searchRequest, true);
62 | return true;
63 | }
64 |
65 | @Override
66 | public boolean onOptionsItemSelected(MenuItem item) {
67 | return super.onOptionsItemSelected(item);
68 | }
69 |
70 | @Override
71 | public boolean onQueryTextSubmit(String query) {
72 | return false;
73 | }
74 |
75 | @Override
76 | public boolean onQueryTextChange(String newText) {
77 | if (newText != null && !newText.isEmpty()) {
78 | List list = new ArrayList<>();
79 | for (String value : Arrays.asList(getResources().getStringArray(R.array.countries))) {
80 | if (value.contains(newText)) {
81 | list.add(value);
82 | }
83 | }
84 | mListFragment.setList(list);
85 | return true;
86 | } else {
87 | mListFragment.setList(Arrays.asList(getResources().getStringArray(R.array.countries)));
88 | }
89 | return false;
90 | }
91 |
92 | @Override
93 | public void onClick(View v) {
94 | mDrawerLayout.openDrawer(GravityCompat.START);
95 | }
96 |
97 | @Override
98 | protected void onSaveInstanceState(Bundle outState) {
99 | super.onSaveInstanceState(outState);
100 | outState.putString(SEARCH, mSearchView.getQuery().toString());
101 | }
102 |
103 | @Override
104 | protected void onRestoreInstanceState(@NonNull Bundle savedInstanceState) {
105 | super.onRestoreInstanceState(savedInstanceState);
106 | searchRequest = savedInstanceState.getString(SEARCH);
107 | }
108 |
109 | @Override
110 | public boolean onNavigationItemSelected(MenuItem menuItem) {
111 | Intent webSiteIntent = new Intent(Intent.ACTION_VIEW);
112 | switch (menuItem.getItemId()) {
113 | case R.id.item_more_articles:
114 | webSiteIntent.setData(Uri.parse(getString(R.string.link_more_articles)));
115 | startActivity(webSiteIntent);
116 | mDrawerLayout.closeDrawers();
117 | return true;
118 | case R.id.item_github:
119 | webSiteIntent.setData(Uri.parse(getString(R.string.link_to_github)));
120 | startActivity(webSiteIntent);
121 | mDrawerLayout.closeDrawers();
122 | return true;
123 | case R.id.item_follow_google_plus:
124 | webSiteIntent.setData(Uri.parse(getString(R.string.link_follow_me_google_plus)));
125 | startActivity(webSiteIntent);
126 | mDrawerLayout.closeDrawers();
127 | return true;
128 | case R.id.item_follow_twitter:
129 | webSiteIntent.setData(Uri.parse(getString(R.string.link_follow_me_google_twitter)));
130 | startActivity(webSiteIntent);
131 | mDrawerLayout.closeDrawers();
132 | return true;
133 | case R.id.item_follow_linkedin:
134 | webSiteIntent.setData(Uri.parse(getString(R.string.link_follow_me_google_linked_in)));
135 | startActivity(webSiteIntent);
136 | mDrawerLayout.closeDrawers();
137 | return true;
138 | case R.id.item_join_facebook:
139 | webSiteIntent.setData(Uri.parse(getString(R.string.link_join_to_facebook_community)));
140 | startActivity(webSiteIntent);
141 | mDrawerLayout.closeDrawers();
142 | return true;
143 | }
144 | return false;
145 | }
146 | }
147 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_action_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexZhukovich/NestedToolbarTutorial/059188af2948e59026ef99c2ab6452555ee4f033/app/src/main/res/drawable-hdpi/ic_action_menu.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexZhukovich/NestedToolbarTutorial/059188af2948e59026ef99c2ab6452555ee4f033/app/src/main/res/drawable-hdpi/ic_action_search.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_action_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexZhukovich/NestedToolbarTutorial/059188af2948e59026ef99c2ab6452555ee4f033/app/src/main/res/drawable-mdpi/ic_action_menu.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexZhukovich/NestedToolbarTutorial/059188af2948e59026ef99c2ab6452555ee4f033/app/src/main/res/drawable-mdpi/ic_action_search.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_action_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexZhukovich/NestedToolbarTutorial/059188af2948e59026ef99c2ab6452555ee4f033/app/src/main/res/drawable-xhdpi/ic_action_menu.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexZhukovich/NestedToolbarTutorial/059188af2948e59026ef99c2ab6452555ee4f033/app/src/main/res/drawable-xhdpi/ic_action_search.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_action_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexZhukovich/NestedToolbarTutorial/059188af2948e59026ef99c2ab6452555ee4f033/app/src/main/res/drawable-xxhdpi/ic_action_menu.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexZhukovich/NestedToolbarTutorial/059188af2948e59026ef99c2ab6452555ee4f033/app/src/main/res/drawable-xxhdpi/ic_action_search.png
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
15 |
24 |
28 |
32 |
37 |
41 |
42 |
43 |
44 |
51 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/drawer_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_detail.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_card.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/drawer_menu.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexZhukovich/NestedToolbarTutorial/059188af2948e59026ef99c2ab6452555ee4f033/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexZhukovich/NestedToolbarTutorial/059188af2948e59026ef99c2ab6452555ee4f033/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexZhukovich/NestedToolbarTutorial/059188af2948e59026ef99c2ab6452555ee4f033/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexZhukovich/NestedToolbarTutorial/059188af2948e59026ef99c2ab6452555ee4f033/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexZhukovich/NestedToolbarTutorial/059188af2948e59026ef99c2ab6452555ee4f033/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 96dp
6 | 64dp
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/values-sw600dp-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 128dp
6 | 64dp
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/values-sw600dp-port/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 128dp
6 | 48dp
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 16dp
3 | 16dp
4 | 112dp
5 | 32dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | NestedToolbar Demo
3 |
4 | Search
5 | Card toolbar (Nested toolbar) in Android application
6 |
7 | Afghanistan
8 | Albania
9 | Algeria
10 | American Samoa
11 | Andorra
12 | Angola
13 | Anguilla
14 | Antarctica
15 | Antigua and Barbuda
16 | Argentina
17 | Armenia
18 | Aruba
19 | Australia
20 | Austria
21 | Azerbaijan
22 | Bahamas
23 | Bahrain
24 | Bangladesh
25 | Barbados
26 | Belarus
27 | Belgium
28 | Belize
29 | Benin
30 | Bermuda
31 | Bhutan
32 | Bolivia
33 | Bosnia and Herzegovina
34 | Botswana
35 | Brazil
36 | British Indian Ocean Territory
37 | British Virgin Islands
38 | Brunei
39 | Bulgaria
40 | Burkina Faso
41 | Burma (Myanmar)
42 | Burundi
43 | Cambodia
44 | Cameroon
45 | Canada
46 | Cape Verde
47 | Cayman Islands
48 | Central African Republic
49 | Chad
50 | Chile
51 | China
52 | Christmas Island
53 | Cocos (Keeling) Islands
54 | Colombia
55 | Comoros
56 | Cook Islands
57 | Costa Rica
58 | Croatia
59 | Cuba
60 | Cyprus
61 | Czech Republic
62 | Democratic Republic of the Congo
63 | Denmark
64 | Djibouti
65 | Dominica
66 | Dominican Republic
67 | Ecuador
68 | Egypt
69 | El Salvador
70 | Equatorial Guinea
71 | Eritrea
72 | Estonia
73 | Ethiopia
74 | Falkland Islands
75 | Faroe Islands
76 | Fiji
77 | Finland
78 | France
79 | French Polynesia
80 | Gabon
81 | Gambia
82 | Gaza Strip
83 | Georgia
84 | Germany
85 | Ghana
86 | Gibraltar
87 | Greece
88 | Greenland
89 | Grenada
90 | Guam
91 | Guatemala
92 | Guinea
93 | Guinea-Bissau
94 | Guyana
95 | Haiti
96 | Holy See (Vatican City)
97 | Honduras
98 | Hong Kong
99 | Hungary
100 | Iceland
101 | India
102 | Indonesia
103 | Iran
104 | Iraq
105 | Ireland
106 | Isle of Man
107 | Israel
108 | Italy
109 | Ivory Coast
110 | Jamaica
111 | Japan
112 | Jersey
113 | Jordan
114 | Kazakhstan
115 | Kenya
116 | Kiribati
117 | Kosovo
118 | Kuwait
119 | Kyrgyzstan
120 | Laos
121 | Latvia
122 | Lebanon
123 | Lesotho
124 | Liberia
125 | Libya
126 | Liechtenstein
127 | Lithuania
128 | Luxembourg
129 | Macau
130 | Macedonia
131 | Madagascar
132 | Malawi
133 | Malaysia
134 | Maldives
135 | Mali
136 | Malta
137 | Marshall Islands
138 | Mauritania
139 | Mauritius
140 | Mayotte
141 | Mexico
142 | Micronesia
143 | Moldova
144 | Monaco
145 | Mongolia
146 | Montenegro
147 | Montserrat
148 | Morocco
149 | Mozambique
150 | Namibia
151 | Nauru
152 | Nepal
153 | Netherlands
154 | Netherlands Antilles
155 | New Caledonia
156 | New Zealand
157 | Nicaragua
158 | Niger
159 | Nigeria
160 | Niue
161 | Norfolk Island
162 | North Korea
163 | Northern Mariana Islands
164 | Norway
165 | Oman
166 | Pakistan
167 | Palau
168 | Panama
169 | Papua New Guinea
170 | Paraguay
171 | Peru
172 | Philippines
173 | Pitcairn Islands
174 | Poland
175 | Portugal
176 | Puerto Rico
177 | Qatar
178 | Republic of the Congo
179 | Romania
180 | Russia
181 | Rwanda
182 | Saint Barthelemy
183 | Saint Helena
184 | Saint Kitts and Nevis
185 | Saint Lucia
186 | Saint Martin
187 | Saint Pierre and Miquelon
188 | Saint Vincent and the Grenadines
189 | Samoa
190 | San Marino
191 | Sao Tome and Principe
192 | Saudi Arabia
193 | Senegal
194 | Serbia
195 | Seychelles
196 | Sierra Leone
197 | Singapore
198 | Slovakia
199 | Slovenia
200 | Solomon Islands
201 | Somalia
202 | South Africa
203 | South Korea
204 | Spain
205 | Sri Lanka
206 | Sudan
207 | Suriname
208 | Swaziland
209 | Sweden
210 | Switzerland
211 | Syria
212 | Taiwan
213 | Tajikistan
214 | Tanzania
215 | Thailand
216 | Timor-Leste
217 | Togo
218 | Tokelau
219 | Tonga
220 | Trinidad and Tobago
221 | Tunisia
222 | Turkey
223 | Turkmenistan
224 | Turks and Caicos Islands
225 | Tuvalu
226 | Uganda
227 | Ukraine
228 | United Arab Emirates
229 | United Kingdom
230 | United States
231 | Uruguay
232 | US Virgin Islands
233 | Uzbekistan
234 | Vanuatu
235 | Venezuela
236 | Vietnam
237 | Wallis and Futuna
238 | West Bank
239 | Yemen
240 | Zambia
241 | Zimbabwe
242 |
243 |
244 | - @string/afghanistan
245 | - @string/albania
246 | - @string/algeria
247 | - @string/american_samoa
248 | - @string/andorra
249 | - @string/angola
250 | - @string/anguilla
251 | - @string/antarctica
252 | - @string/antigua_and_barbuda
253 | - @string/argentina
254 | - @string/armenia
255 | - @string/aruba
256 | - @string/australia
257 | - @string/austria
258 | - @string/azerbaijan
259 | - @string/bahamas
260 | - @string/bahrain
261 | - @string/bangladesh
262 | - @string/barbados
263 | - @string/belarus
264 | - @string/belgium
265 | - @string/belize
266 | - @string/benin
267 | - @string/bermuda
268 | - @string/bhutan
269 | - @string/bolivia
270 | - @string/bosnia_and_herzegovina
271 | - @string/botswana
272 | - @string/brazil
273 | - @string/british_indian_ocean_territory
274 | - @string/british_virgin_islands
275 | - @string/brunei
276 | - @string/bulgaria
277 | - @string/burkina_faso
278 | - @string/burma_myanmar
279 | - @string/burundi
280 | - @string/cambodia
281 | - @string/cameroon
282 | - @string/canada
283 | - @string/cape_verde
284 | - @string/cayman_islands
285 | - @string/central_african_republic
286 | - @string/chad
287 | - @string/chile
288 | - @string/china
289 | - @string/christmas_island
290 | - @string/cocos_keeling_islands
291 | - @string/colombia
292 | - @string/comoros
293 | - @string/cook_islands
294 | - @string/costa_rica
295 | - @string/croatia
296 | - @string/cuba
297 | - @string/cyprus
298 | - @string/czech_republic
299 | - @string/democratic_republic_of_the_congo
300 | - @string/denmark
301 | - @string/djibouti
302 | - @string/dominica
303 | - @string/dominican_republic
304 | - @string/ecuador
305 | - @string/egypt
306 | - @string/el_salvador
307 | - @string/equatorial_guinea
308 | - @string/eritrea
309 | - @string/estonia
310 | - @string/ethiopia
311 | - @string/falkland_islands
312 | - @string/faroe_islands
313 | - @string/fiji
314 | - @string/finland
315 | - @string/france
316 | - @string/french_polynesia
317 | - @string/gabon
318 | - @string/gambia
319 | - @string/gaza_strip
320 | - @string/georgia
321 | - @string/germany
322 | - @string/ghana
323 | - @string/gibraltar
324 | - @string/greece
325 | - @string/greenland
326 | - @string/grenada
327 | - @string/guam
328 | - @string/guatemala
329 | - @string/guinea
330 | - @string/guinea_bissau
331 | - @string/guyana
332 | - @string/haiti
333 | - @string/holy_see_vatican_city
334 | - @string/honduras
335 | - @string/hong_kong
336 | - @string/hungary
337 | - @string/iceland
338 | - @string/india
339 | - @string/indonesia
340 | - @string/iran
341 | - @string/iraq
342 | - @string/ireland
343 | - @string/isle_of_man
344 | - @string/israel
345 | - @string/italy
346 | - @string/ivory_coast
347 | - @string/jamaica
348 | - @string/japan
349 | - @string/jersey
350 | - @string/jordan
351 | - @string/kazakhstan
352 | - @string/kenya
353 | - @string/kiribati
354 | - @string/kosovo
355 | - @string/kuwait
356 | - @string/kyrgyzstan
357 | - @string/laos
358 | - @string/latvia
359 | - @string/lebanon
360 | - @string/lesotho
361 | - @string/liberia
362 | - @string/libya
363 | - @string/liechtenstein
364 | - @string/lithuania
365 | - @string/luxembourg
366 | - @string/macau
367 | - @string/macedonia
368 | - @string/madagascar
369 | - @string/malawi
370 | - @string/malaysia
371 | - @string/maldives
372 | - @string/mali
373 | - @string/malta
374 | - @string/marshall_islands
375 | - @string/mauritania
376 | - @string/mauritius
377 | - @string/mayotte
378 | - @string/mexico
379 | - @string/micronesia
380 | - @string/moldova
381 | - @string/monaco
382 | - @string/mongolia
383 | - @string/montenegro
384 | - @string/montserrat
385 | - @string/morocco
386 | - @string/mozambique
387 | - @string/namibia
388 | - @string/nauru
389 | - @string/nepal
390 | - @string/netherlands
391 | - @string/netherlands_antilles
392 | - @string/new_caledonia
393 | - @string/new_zealand
394 | - @string/nicaragua
395 | - @string/niger
396 | - @string/nigeria
397 | - @string/niue
398 | - @string/norfolk_island
399 | - @string/north_korea
400 | - @string/northern_mariana_islands
401 | - @string/norway
402 | - @string/oman
403 | - @string/pakistan
404 | - @string/palau
405 | - @string/panama
406 | - @string/papua_new_guinea
407 | - @string/paraguay
408 | - @string/peru
409 | - @string/philippines
410 | - @string/pitcairn_islands
411 | - @string/poland
412 | - @string/portugal
413 | - @string/puerto_rico
414 | - @string/qatar
415 | - @string/republic_of_the_congo
416 | - @string/romania
417 | - @string/russia
418 | - @string/rwanda
419 | - @string/saint_barthelemy
420 | - @string/saint_helena
421 | - @string/saint_kitts_and_nevis
422 | - @string/saint_lucia
423 | - @string/saint_martin
424 | - @string/saint_pierre_and_miquelon
425 | - @string/saint_vincent_and_the_grenadines
426 | - @string/samoa
427 | - @string/san_marino
428 | - @string/sao_tome_and_principe
429 | - @string/saudi_arabia
430 | - @string/senegal
431 | - @string/serbia
432 | - @string/seychelles
433 | - @string/sierra_leone
434 | - @string/singapore
435 | - @string/slovakia
436 | - @string/slovenia
437 | - @string/solomon_islands
438 | - @string/somalia
439 | - @string/south_africa
440 | - @string/south_korea
441 | - @string/spain
442 | - @string/sri_lanka
443 | - @string/sudan
444 | - @string/suriname
445 | - @string/swaziland
446 | - @string/sweden
447 | - @string/switzerland
448 | - @string/syria
449 | - @string/taiwan
450 | - @string/tajikistan
451 | - @string/tanzania
452 | - @string/thailand
453 | - @string/timor_leste
454 | - @string/togo
455 | - @string/tokelau
456 | - @string/tonga
457 | - @string/trinidad_and_tobago
458 | - @string/tunisia
459 | - @string/turkey
460 | - @string/turkmenistan
461 | - @string/turks_and_caicos_islands
462 | - @string/tuvalu
463 | - @string/uganda
464 | - @string/ukraine
465 | - @string/united_arab_emirates
466 | - @string/united_kingdom
467 | - @string/united_states
468 | - @string/uruguay
469 | - @string/us_virgin_islands
470 | - @string/uzbekistan
471 | - @string/vanuatu
472 | - @string/venezuela
473 | - @string/vietnam
474 | - @string/wallis_and_futuna
475 | - @string/west_bank
476 | - @string/yemen
477 | - @string/zambia
478 | - @string/zimbabwe
479 |
480 |
481 | Read more articles
482 | Source code
483 | Follow me on Google+
484 | Follow me on Twitter
485 | Follow me on LinkedIn
486 | Join to facebook community
487 |
488 | http://alexzh.com
489 | https://github.com/AlexZhukovich
490 | https://plus.google.com/u/0/107585683427004449259/
491 | https://twitter.com/Alex_Zhukovich
492 | https://linkedin.com/pub/alex-zhukovich/76/78a/b05
493 | https://www.facebook.com/mobiledevelopment.alexzh
494 |
495 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.2.3'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexZhukovich/NestedToolbarTutorial/059188af2948e59026ef99c2ab6452555ee4f033/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Aug 14 11:17:06 CEST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------