├── .gitignore
├── .idea
├── codeStyles
│ └── Project.xml
├── gradle.xml
├── jarRepositories.xml
├── misc.xml
└── runConfigurations.xml
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── artsystem
│ │ └── gmailapplocal
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── artsystem
│ │ │ └── gmailapplocal
│ │ │ ├── MainActivity.java
│ │ │ ├── data
│ │ │ ├── Constant.java
│ │ │ └── FakeDataSource.java
│ │ │ ├── maillist
│ │ │ ├── MailAdapter.java
│ │ │ ├── MailCategoryItem.java
│ │ │ ├── MailDiffUtilCallback.java
│ │ │ ├── MailItem.java
│ │ │ └── MailSimpleItem.java
│ │ │ ├── navigation
│ │ │ ├── LabelItem.java
│ │ │ ├── MenuItem.java
│ │ │ ├── NavAdapter.java
│ │ │ ├── NavItem.java
│ │ │ └── NavMenuItemCallback.java
│ │ │ └── searchactivity
│ │ │ └── SearchActivity.java
│ └── res
│ │ ├── drawable-v21
│ │ ├── ic_menu_camera.xml
│ │ ├── ic_menu_gallery.xml
│ │ └── ic_menu_slideshow.xml
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ ├── adobe.png
│ │ ├── androidstudio.png
│ │ ├── bg_cat_counter.xml
│ │ ├── bg_selected.xml
│ │ ├── girl0.png
│ │ ├── google.png
│ │ ├── ic_baseline_all_inbox_24.xml
│ │ ├── ic_baseline_arrow_back_24.xml
│ │ ├── ic_baseline_calendar_today_24.xml
│ │ ├── ic_baseline_delete_outline_24.xml
│ │ ├── ic_baseline_history_24.xml
│ │ ├── ic_baseline_inbox_24.xml
│ │ ├── ic_baseline_keyboard_voice_24.xml
│ │ ├── ic_baseline_mail_outline_24.xml
│ │ ├── ic_baseline_menu_24.xml
│ │ ├── ic_baseline_person_outline_24.xml
│ │ ├── ic_baseline_search_24.xml
│ │ ├── ic_baseline_snooze_24.xml
│ │ ├── ic_baseline_star_24.xml
│ │ ├── ic_baseline_star_border_24.xml
│ │ ├── ic_launcher_background.xml
│ │ ├── ic_outline_account_circle_24.xml
│ │ ├── ic_outline_create_24.xml
│ │ ├── ic_outline_drafts_24.xml
│ │ ├── ic_outline_forum_24.xml
│ │ ├── ic_outline_info_24.xml
│ │ ├── ic_outline_label_24.xml
│ │ ├── ic_outline_local_offer_24.xml
│ │ ├── ic_outline_send_24.xml
│ │ ├── ic_outline_settings_24.xml
│ │ ├── nav_select_bg.xml
│ │ ├── pnggoogle.png
│ │ ├── side_nav_bar.xml
│ │ ├── user.png
│ │ ├── user2.png
│ │ ├── user3.png
│ │ ├── user4.png
│ │ ├── user5.png
│ │ ├── usernoimg.jpg
│ │ ├── usernoimg0.jpg
│ │ └── usernoimg01.png
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── activity_search.xml
│ │ ├── item_category.xml
│ │ ├── item_mail.xml
│ │ ├── item_nav_label.xml
│ │ ├── item_nav_menu.xml
│ │ ├── item_simple_search.xml
│ │ └── search_bar.xml
│ │ ├── menu
│ │ ├── activity_main_drawer.xml
│ │ └── nav_test.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── values
│ │ ├── arrays.xml
│ │ ├── attrs.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── drawables.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ │ └── xml
│ │ ├── root_preferences.xml
│ │ └── searchable.xml
│ └── test
│ └── java
│ └── com
│ └── artsystem
│ └── gmailapplocal
│ └── ExampleUnitTest.java
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | xmlns:android
14 |
15 | ^$
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | xmlns:.*
25 |
26 | ^$
27 |
28 |
29 | BY_NAME
30 |
31 |
32 |
33 |
34 |
35 |
36 | .*:id
37 |
38 | http://schemas.android.com/apk/res/android
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | .*:name
48 |
49 | http://schemas.android.com/apk/res/android
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | name
59 |
60 | ^$
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | style
70 |
71 | ^$
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | .*
81 |
82 | ^$
83 |
84 |
85 | BY_NAME
86 |
87 |
88 |
89 |
90 |
91 |
92 | .*
93 |
94 | http://schemas.android.com/apk/res/android
95 |
96 |
97 | ANDROID_ATTRIBUTE_ORDER
98 |
99 |
100 |
101 |
102 |
103 |
104 | .*
105 |
106 | .*
107 |
108 |
109 | BY_NAME
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
20 |
21 |
--------------------------------------------------------------------------------
/.idea/jarRepositories.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 |
--------------------------------------------------------------------------------
/.idea/misc.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 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 30
5 | buildToolsVersion "30.0.1"
6 |
7 | defaultConfig {
8 | applicationId "com.artsystem.gmailapplocal"
9 | minSdkVersion 16
10 | targetSdkVersion 30
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(dir: "libs", include: ["*.jar"])
27 | implementation 'androidx.appcompat:appcompat:1.2.0'
28 | implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
29 | implementation 'androidx.legacy:legacy-support-v4:1.0.0'
30 | implementation 'androidx.cardview:cardview:1.0.0'
31 | implementation 'androidx.preference:preference:1.1.1'
32 | implementation 'androidx.navigation:navigation-fragment:2.3.1'
33 | implementation 'androidx.navigation:navigation-ui:2.3.1'
34 | implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
35 | testImplementation 'junit:junit:4.12'
36 | androidTestImplementation 'androidx.test.ext:junit:1.1.2'
37 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
38 |
39 |
40 |
41 | // Glide
42 | implementation "com.github.bumptech.glide:glide:4.9.0"
43 |
44 | // Material Components
45 | implementation 'com.google.android.material:material:1.2.0'
46 |
47 |
48 |
49 |
50 |
51 | }
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/artsystem/gmailapplocal/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.artsystem.gmailapplocal;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 | assertEquals("com.artsystem.gmailapplocal", appContext.getPackageName());
25 | }
26 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/java/com/artsystem/gmailapplocal/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.artsystem.gmailapplocal;
2 |
3 | import androidx.annotation.NonNull;
4 | import androidx.appcompat.app.AppCompatActivity;
5 | import androidx.drawerlayout.widget.DrawerLayout;
6 | import androidx.recyclerview.widget.ItemTouchHelper;
7 | import androidx.recyclerview.widget.LinearLayoutManager;
8 | import androidx.recyclerview.widget.RecyclerView;
9 |
10 | import android.app.Activity;
11 | import android.content.Intent;
12 | import android.graphics.Color;
13 | import android.os.Build;
14 | import android.os.Bundle;
15 | import android.view.View;
16 | import android.widget.EditText;
17 | import android.widget.ImageView;
18 | import android.widget.TextView;
19 | import android.widget.Toast;
20 |
21 | import com.artsystem.gmailapplocal.data.FakeDataSource;
22 | import com.artsystem.gmailapplocal.maillist.MailAdapter;
23 | import com.artsystem.gmailapplocal.maillist.MailDiffUtilCallback;
24 | import com.artsystem.gmailapplocal.navigation.LabelItem;
25 | import com.artsystem.gmailapplocal.navigation.MenuItem;
26 | import com.artsystem.gmailapplocal.navigation.NavAdapter;
27 | import com.artsystem.gmailapplocal.navigation.NavItem;
28 | import com.artsystem.gmailapplocal.navigation.NavMenuItemCallback;
29 | import com.artsystem.gmailapplocal.searchactivity.SearchActivity;
30 | import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
31 |
32 | import java.util.ArrayList;
33 | import java.util.List;
34 |
35 |
36 | public class MainActivity extends AppCompatActivity {
37 |
38 | private RecyclerView mailRecyclerView,navRecyclerview;
39 | private MailAdapter mailAdapter;
40 | private ExtendedFloatingActionButton extFab;
41 | private TextView editSearch;
42 | private DrawerLayout drawerLayout;
43 | private ImageView iconDL;
44 | private NavAdapter navAdapter;
45 | private int selectedThemeID;
46 |
47 |
48 | @Override
49 | protected void onCreate(Bundle savedInstanceState) {
50 |
51 | selectedThemeID = R.style.DarkTheme;
52 | setTheme(selectedThemeID);
53 |
54 | super.onCreate(savedInstanceState);
55 | setContentView(R.layout.activity_main);
56 |
57 | // if light theme is selected we change to light status bar
58 | if (selectedThemeID == R.style.AppTheme) {
59 | setLightStatusBar(getWindow().getDecorView(),this);
60 | }
61 |
62 |
63 | initViews();
64 | setupFabBehavior();
65 | initNavMenu();
66 | swipeRightToRemove();
67 |
68 | }
69 |
70 | private void initViews() {
71 | extFab = findViewById(R.id.extFab100);
72 | iconDL = findViewById(R.id.menu_icon);
73 | mailRecyclerView = findViewById(R.id.rvmail);
74 | mailAdapter = new MailAdapter(new MailDiffUtilCallback());
75 | mailRecyclerView.setHasFixedSize(true);
76 | mailRecyclerView.setLayoutManager(new LinearLayoutManager(this));
77 | mailRecyclerView.setAdapter(mailAdapter);
78 | mailAdapter.submitList(FakeDataSource.getListMail());
79 | editSearch = findViewById(R.id.eidtsearch);
80 | editSearch.setFocusable(false);
81 | editSearch.setOnClickListener(new View.OnClickListener() {
82 | @Override
83 | public void onClick(View view) {
84 | Intent intent = new Intent(MainActivity.this, SearchActivity.class);
85 | intent.putExtra("themeid",selectedThemeID);
86 | intent.setAction(Intent.ACTION_SEARCH);
87 | startActivity(intent);
88 | }
89 | });
90 | }
91 |
92 | private void swipeRightToRemove() {
93 |
94 | ItemTouchHelper.SimpleCallback simpleItemTouchCallback = new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) {
95 |
96 | @Override
97 | public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
98 | Toast.makeText(MainActivity.this, "on Move", Toast.LENGTH_SHORT).show();
99 | return false;
100 | }
101 |
102 | @Override
103 | public void onSwiped(RecyclerView.ViewHolder viewHolder, int swipeDir) {
104 | Toast.makeText(MainActivity.this, "on Swiped ", Toast.LENGTH_SHORT).show();
105 | //Remove swiped item from list and notify the RecyclerView
106 | int position = viewHolder.getAdapterPosition();
107 | mailAdapter.notifyItemRemoved(position);
108 |
109 | }
110 | };
111 |
112 | ItemTouchHelper itemTouchHelper = new ItemTouchHelper(simpleItemTouchCallback);
113 | itemTouchHelper.attachToRecyclerView(mailRecyclerView);
114 |
115 | }
116 |
117 | private void initNavMenu(){
118 | // TODO: setup navigation recyclerview list
119 | // setup nav adapter
120 | drawerLayout = findViewById(R.id.drawer_layout);
121 | navRecyclerview = drawerLayout.findViewById(R.id.nav_rv);
122 |
123 | iconDL.setOnClickListener(new View.OnClickListener() {
124 | @Override
125 | public void onClick(View view) {
126 | drawerLayout.open();
127 | }
128 | });
129 |
130 | // init nav adapter list
131 | navRecyclerview.setLayoutManager(new LinearLayoutManager(this));
132 | navRecyclerview.setAdapter(navAdapter);
133 | List navMenu = new ArrayList<>();
134 |
135 | navMenu.add(new NavItem(
136 | new MenuItem(R.drawable.ic_baseline_all_inbox_24,"All Inboxes",false,120)
137 | ));
138 | navMenu.add(new NavItem(
139 | new MenuItem(R.drawable.ic_baseline_person_outline_24,"Social",false,20)
140 | ));
141 | navMenu.add(new NavItem(
142 | new MenuItem(R.drawable.ic_outline_local_offer_24,"Promotions",false,120)
143 | ));
144 | navMenu.add(new NavItem(
145 | new MenuItem(R.drawable.ic_outline_forum_24,"Forums",true,5)
146 | ));
147 | navMenu.add(new NavItem(new LabelItem("All LABELS")));
148 |
149 | navMenu.add(new NavItem(
150 | new MenuItem(R.drawable.ic_baseline_star_border_24,"Starred",false)
151 | ));
152 | navMenu.add(new NavItem(
153 | new MenuItem(R.drawable.ic_baseline_snooze_24,"Snoozed",false)
154 | ));
155 | navMenu.add(new NavItem(
156 | new MenuItem(R.drawable.ic_outline_send_24,"Sent",false)
157 | ));
158 | navMenu.add(new NavItem(
159 | new MenuItem(R.drawable.ic_baseline_snooze_24,"Scheduled",false)
160 | ));
161 | navMenu.add(new NavItem(
162 | new MenuItem(R.drawable.ic_outline_drafts_24,"Draft",false,5)
163 | ));
164 | navMenu.add(new NavItem(
165 | new MenuItem(R.drawable.ic_baseline_all_inbox_24,"All Mails",false,120)
166 | ));
167 |
168 | navMenu.add(new NavItem(new LabelItem("GOOGLE APPS")));
169 | navMenu.add(new NavItem(
170 | new MenuItem(R.drawable.ic_baseline_calendar_today_24,"Calendar",false)
171 | ));
172 | navMenu.add(new NavItem(
173 | new MenuItem(R.drawable.ic_baseline_person_outline_24,"Contacts",false)
174 | ));
175 | navMenu.add(new NavItem(
176 | new MenuItem(R.drawable.ic_outline_settings_24,"Settings",false)
177 | ));
178 | navMenu.add(new NavItem(
179 | new MenuItem(R.drawable.ic_baseline_all_inbox_24,"Contacts",false)
180 | ));
181 |
182 |
183 |
184 | navAdapter = new NavAdapter(new NavMenuItemCallback());
185 | navAdapter.submitList(navMenu);
186 | //recyclerView.setAdapter(navAdapter);
187 | navRecyclerview.setAdapter(navAdapter);
188 |
189 |
190 |
191 | }
192 |
193 | private void setupFabBehavior() {
194 |
195 | mailRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
196 |
197 | @Override
198 | public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
199 | super.onScrollStateChanged(recyclerView, newState);
200 | }
201 | @Override
202 | public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
203 |
204 | if (dy > 0) {
205 | // Scrolling up
206 | extFab.shrink();
207 |
208 | } else {
209 | // Scrolling down
210 | extFab.extend();
211 |
212 | }
213 | }
214 | });
215 | }
216 |
217 |
218 | public static void setLightStatusBar(View view, Activity activity){
219 |
220 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
221 | int flags = view.getSystemUiVisibility();
222 | flags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
223 | view.setSystemUiVisibility(flags);
224 | activity.getWindow().setStatusBarColor(Color.WHITE);
225 | }
226 |
227 | }
228 |
229 |
230 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/artsystem/gmailapplocal/data/Constant.java:
--------------------------------------------------------------------------------
1 | package com.artsystem.gmailapplocal.data;
2 |
3 | public class Constant {
4 |
5 |
6 | // Mail recyclerview item types constants
7 | public static final int MAIL_TEXT_TYPE = 0;
8 | public static final int MAIL_CATEGORY_TYPE = 1;
9 | public static final int MAIL_ITEM_TYPE = 2;
10 |
11 | // Navigation recyclerview item types constants
12 | public static final int NAV_TEXT_TYPE = 0;
13 | public static final int NAV_CATEGORY_TYPE = 1;
14 | public static final int NAV_MENU_TYPE = 2;
15 |
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/java/com/artsystem/gmailapplocal/data/FakeDataSource.java:
--------------------------------------------------------------------------------
1 | package com.artsystem.gmailapplocal.data;
2 |
3 | import com.artsystem.gmailapplocal.R;
4 | import com.artsystem.gmailapplocal.maillist.MailCategoryItem;
5 | import com.artsystem.gmailapplocal.maillist.MailItem;
6 | import com.artsystem.gmailapplocal.maillist.MailSimpleItem;
7 |
8 | import java.util.ArrayList;
9 | import java.util.Iterator;
10 | import java.util.List;
11 |
12 | public class FakeDataSource {
13 |
14 |
15 | // Dummy Titles
16 |
17 | public static final String TITLE_1 ="Anna Smith";
18 | public static final String TITLE_2 ="Adobe Creative Cloud Updates";
19 | public static final String TITLE_3 ="Jhon Doe";
20 | public static final String TITLE_4 ="Kelsey Green";
21 | public static final String TITLE_5 ="Space News Latest Update";
22 | public static final String TITLE_6 ="Anna Smith";
23 | public static final String TITLE_7 ="Android Blog Daily Post";
24 | public static final String TITLE_8 ="Google Team";
25 |
26 | // Dummy User Images
27 |
28 | public static final int IMG_1 = R.drawable.pnggoogle;
29 | public static final int IMG_2 = R.drawable.adobe ;
30 | public static final int IMG_3 = R.drawable.user4;
31 | public static final int IMG_4 = R.drawable.user;
32 | public static final int IMG_5 = R.drawable.user2;
33 | public static final int IMG_6 = R.drawable.girl0;
34 | public static final int IMG_7 = R.drawable.androidstudio;
35 |
36 |
37 | // Dummy Mail Content
38 | public static final String Content_1 = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.";
39 |
40 | // Dummy Description
41 | public static final String DESC_1 = "Lorem ipsum dolor sit amet";
42 | public static final String DESC_2 = "Lorem ipsum dolor sit amet";
43 | public static final String DESC_3 = "Lorem ipsum dolor sit amet";
44 | public static final String DESC_4 = "Lorem ipsum dolor sit amet";
45 | public static final String DESC_5 = "Lorem ipsum dolor sit amet";
46 | public static final String DESC_6 = "Lorem ipsum dolor sit amet";
47 | public static final String DESC_7 = "Lorem ipsum dolor sit amet";
48 |
49 |
50 |
51 |
52 |
53 |
54 | public static List getListMail(){
55 |
56 | List data = new ArrayList<>();
57 |
58 | data.add(new MailItem(new MailCategoryItem(
59 | R.drawable.ic_outline_info_24,
60 | "Updates",
61 | "Google, GOG.COM, Uplabs And 19 more...\nCheck Important Recent update",
62 | "",
63 | "YELLOW",
64 | 12
65 | )));
66 |
67 | data.add(new MailItem(new MailCategoryItem(
68 | R.drawable.ic_outline_local_offer_24,
69 | "PROMOTION",
70 | DESC_1,
71 | "GREEN",
72 | "GREEN",
73 | 122
74 | )));
75 |
76 | data.add(new MailItem(new MailCategoryItem(
77 | R.drawable.ic_outline_forum_24,
78 | TITLE_1,
79 | DESC_1,
80 | "PURPLE",
81 | "PURPLE",
82 | 5
83 | )));
84 |
85 |
86 |
87 |
88 | data.add(new MailItem(new MailSimpleItem(
89 | 1,
90 | TITLE_1,
91 | DESC_1,
92 | IMG_1,
93 | Content_1,
94 | true
95 | )));
96 |
97 | data.add(new MailItem(new MailSimpleItem(
98 | 2,
99 | TITLE_2,
100 | DESC_1,
101 | R.drawable.usernoimg01,
102 | Content_1
103 | )));
104 |
105 | data.add(new MailItem(new MailSimpleItem(
106 | 3,
107 | TITLE_3,
108 | DESC_1,
109 | R.drawable.usernoimg0,
110 | Content_1,
111 | true,
112 | true
113 | )));
114 | data.add(new MailItem(new MailSimpleItem(
115 | 4,
116 | TITLE_4,
117 | DESC_1,
118 | IMG_4,
119 | Content_1
120 | )));
121 | data.add(new MailItem(new MailSimpleItem(
122 | 5,
123 | TITLE_5,
124 | DESC_1,
125 | IMG_5,
126 | Content_1
127 |
128 | )));
129 | data.add(new MailItem(new MailSimpleItem(
130 | 6,
131 | TITLE_6,
132 | DESC_1,
133 | IMG_6,
134 | Content_1
135 | )));
136 | data.add(new MailItem(new MailSimpleItem(
137 | 7,
138 | TITLE_7,
139 | DESC_1,
140 | IMG_7,
141 | Content_1,
142 | true
143 | )));
144 | data.add(new MailItem(new MailSimpleItem(
145 | 8,
146 | TITLE_6,
147 | DESC_1,
148 | IMG_6,
149 | Content_1,
150 | true
151 | )));
152 | data.add(new MailItem(new MailSimpleItem(
153 | 9,
154 | TITLE_7,
155 | DESC_1,
156 | R.drawable.usernoimg01,
157 | Content_1
158 | )));
159 | data.add(new MailItem(new MailSimpleItem(
160 | 10,
161 | TITLE_6,
162 | DESC_1,
163 | IMG_6,
164 | Content_1
165 | )));
166 | data.add(new MailItem(new MailSimpleItem(
167 | 11,
168 | TITLE_7,
169 | DESC_1,
170 | IMG_1,
171 | Content_1
172 | )));
173 | data.add(new MailItem(new MailSimpleItem(
174 | 12,
175 | TITLE_6,
176 | DESC_1,
177 | R.drawable.usernoimg0,
178 | Content_1,
179 | true
180 | )));
181 | data.add(new MailItem(new MailSimpleItem(
182 | 13,
183 | TITLE_7,
184 | DESC_1,
185 | IMG_5,
186 | Content_1
187 | )));
188 |
189 |
190 |
191 | return data;
192 | }
193 |
194 |
195 | }
196 |
--------------------------------------------------------------------------------
/app/src/main/java/com/artsystem/gmailapplocal/maillist/MailAdapter.java:
--------------------------------------------------------------------------------
1 | package com.artsystem.gmailapplocal.maillist;
2 |
3 | import android.graphics.Typeface;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.ImageView;
8 | import android.widget.TextView;
9 |
10 | import androidx.annotation.NonNull;
11 | import androidx.core.graphics.drawable.DrawableCompat;
12 | import androidx.recyclerview.widget.DiffUtil;
13 | import androidx.recyclerview.widget.ListAdapter;
14 | import androidx.recyclerview.widget.RecyclerView;
15 |
16 | import com.artsystem.gmailapplocal.R;
17 | import com.artsystem.gmailapplocal.data.Constant;
18 | import com.bumptech.glide.Glide;
19 |
20 | public class MailAdapter extends ListAdapter {
21 |
22 |
23 | public MailAdapter(@NonNull DiffUtil.ItemCallback diffCallback) {
24 | super(diffCallback);
25 | }
26 |
27 |
28 | @NonNull
29 | @Override
30 | public MailBaseViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
31 |
32 | switch (viewType) {
33 | case Constant.MAIL_CATEGORY_TYPE :
34 | return new CatViewHolder (LayoutInflater.from(parent.getContext())
35 | .inflate(R.layout.item_category,parent,false));
36 | case Constant.MAIL_ITEM_TYPE:
37 | return new MailViewHolder (LayoutInflater.from(parent.getContext())
38 | .inflate(R.layout.item_mail,parent,false));
39 | default: return new MailViewHolder (LayoutInflater.from(parent.getContext())
40 | .inflate(R.layout.item_mail,parent,false));
41 | }
42 |
43 |
44 | }
45 |
46 | @Override
47 | public void onBindViewHolder(@NonNull MailBaseViewHolder holder, int position) {
48 |
49 | holder.bindData(getItem(position));
50 |
51 | }
52 |
53 | @Override
54 | public int getItemViewType(int position) {
55 | return getItem(position).getType();
56 | }
57 |
58 |
59 | // Base View Holder:
60 | public abstract class MailBaseViewHolder extends RecyclerView.ViewHolder{
61 |
62 | abstract void bindData(MailItem item);
63 |
64 | public MailBaseViewHolder(@NonNull View itemView) {
65 | super(itemView);
66 | }
67 | }
68 |
69 |
70 |
71 | // categorie item ViewHolder
72 | public class CatViewHolder extends MailBaseViewHolder{
73 |
74 | TextView tvTitle,tvDesc,tvContent,tvNum;
75 | ImageView imgCat;
76 |
77 |
78 | public CatViewHolder(@NonNull View itemView) {
79 | super(itemView);
80 |
81 | tvTitle = itemView.findViewById(R.id.item_cat_title);
82 | //tvContent = itemView.findViewById(R.id.item_mail_content);
83 | tvDesc = itemView.findViewById(R.id.item_cat_description);
84 | tvNum = itemView.findViewById(R.id.item_cat_counter);
85 |
86 | imgCat = itemView.findViewById(R.id.item_cat_img);
87 | }
88 |
89 | @Override
90 | void bindData(MailItem item) {
91 |
92 | tvTitle.setText(item.getCategoryItem().getTitle());
93 | tvDesc.setText(item.getCategoryItem().getDesc());
94 | tvNum.setText(item.getCategoryItem().getNumNotif()+" new");
95 | Glide.with(imgCat.getContext()).load(item.getCategoryItem().getIcon()).into(imgCat);
96 | switch (item.getCategoryItem().getColor()) {
97 |
98 | case "GREEN" :
99 | imgCat.setColorFilter(imgCat.getContext().getResources().getColor(R.color.green));
100 | DrawableCompat.setTint(tvNum.getBackground(),imgCat.getContext().getResources().getColor(R.color.green));
101 | break;
102 | case "BLACK" :
103 | imgCat.setColorFilter(imgCat.getContext().getResources().getColor(R.color.black));
104 | DrawableCompat.setTint(tvNum.getBackground(),imgCat.getContext().getResources().getColor(R.color.black));
105 | break;
106 | case "YELLOW" :
107 | imgCat.setColorFilter(imgCat.getContext().getResources().getColor(R.color.yellow));
108 | DrawableCompat.setTint(tvNum.getBackground(),imgCat.getContext().getResources().getColor(R.color.yellow));
109 | break;
110 | case "BLUE" :
111 | imgCat.setColorFilter(imgCat.getContext().getResources().getColor(R.color.blue));
112 | DrawableCompat.setTint(tvNum.getBackground(),imgCat.getContext().getResources().getColor(R.color.blue));
113 | break;
114 | case "PURPLE" :
115 | imgCat.setColorFilter(imgCat.getContext().getResources().getColor(R.color.purple));
116 | DrawableCompat.setTint(tvNum.getBackground(),imgCat.getContext().getResources().getColor(R.color.purple));
117 | break;
118 | default: tvNum.setBackgroundColor(imgCat.getContext().getResources().getColor(R.color.red));
119 |
120 | }
121 |
122 | }
123 | }
124 |
125 |
126 |
127 | // mail item viewholder
128 | public class MailViewHolder extends MailBaseViewHolder{
129 |
130 | TextView tvTitle,tvDesc,tvContent,tvDate;
131 | ImageView imgUser,imgFav;
132 |
133 |
134 |
135 | public MailViewHolder(@NonNull View itemView) {
136 | super(itemView);
137 | tvTitle = itemView.findViewById(R.id.item_mail_title);
138 | tvContent = itemView.findViewById(R.id.item_mail_content);
139 | tvDesc = itemView.findViewById(R.id.item_mail_description);
140 | tvDate = itemView.findViewById(R.id.item_mail_date);
141 | imgUser = itemView.findViewById(R.id.item_mail_img);
142 | imgFav = itemView.findViewById(R.id.item_mail_fav);
143 |
144 |
145 | }
146 |
147 |
148 | @Override
149 | void bindData(MailItem item) {
150 | setSelected(item.getSimpleItem().isRead());
151 | setFav(item.getSimpleItem().isFav());
152 | tvTitle.setText(item.getSimpleItem().getTitle());
153 | tvDesc.setText(item.getSimpleItem().getDescription());
154 | tvContent.setText(item.getSimpleItem().getContent());
155 | Glide.with(imgUser.getContext()).load(item.getSimpleItem().getImgUrl()).circleCrop().into(imgUser);
156 |
157 | }
158 |
159 |
160 | void setSelected(boolean isRead) {
161 |
162 | if (isRead) {
163 |
164 | tvTitle.setTypeface(Typeface.DEFAULT);
165 | tvDesc.setTypeface(Typeface.DEFAULT);
166 | tvDate.setTypeface(Typeface.DEFAULT);
167 |
168 | }
169 |
170 | else {
171 | tvTitle.setTypeface(Typeface.DEFAULT_BOLD);
172 | tvDesc.setTypeface(Typeface.DEFAULT_BOLD);
173 | tvDate.setTypeface(Typeface.DEFAULT_BOLD);
174 | }
175 |
176 | }
177 | private void setFav(boolean fav) {
178 | if (fav) {
179 | imgFav.setImageResource(R.drawable.ic_baseline_star_24);
180 | imgFav.setColorFilter(imgFav.getContext().getResources().getColor(R.color.yellow));
181 | }
182 | else
183 | {
184 | imgFav.setImageResource(R.drawable.ic_baseline_star_border_24);
185 | imgFav.setColorFilter(imgFav.getContext().getResources().getColor(R.color.light_text_sec_color));
186 |
187 | }
188 |
189 | }
190 |
191 | }
192 |
193 |
194 |
195 | }
196 |
--------------------------------------------------------------------------------
/app/src/main/java/com/artsystem/gmailapplocal/maillist/MailCategoryItem.java:
--------------------------------------------------------------------------------
1 | package com.artsystem.gmailapplocal.maillist;
2 |
3 | public class MailCategoryItem {
4 |
5 | private int icon;
6 | private String title,desc,content;
7 | private String color;
8 | private int numNotif;
9 |
10 | public MailCategoryItem(int icon, String title, String desc, String content, String color, int numNotif) {
11 | this.icon = icon;
12 | this.title = title;
13 | this.desc = desc;
14 | this.content = content;
15 | this.color = color;
16 | this.numNotif = numNotif;
17 | }
18 |
19 | public int getIcon() {
20 | return icon;
21 | }
22 |
23 | public void setIcon(int icon) {
24 | this.icon = icon;
25 | }
26 |
27 | public String getTitle() {
28 | return title;
29 | }
30 |
31 | public void setTitle(String title) {
32 | this.title = title;
33 | }
34 |
35 | public String getDesc() {
36 | return desc;
37 | }
38 |
39 | public void setDesc(String desc) {
40 | this.desc = desc;
41 | }
42 |
43 | public String getContent() {
44 | return content;
45 | }
46 |
47 | public void setContent(String content) {
48 | this.content = content;
49 | }
50 |
51 | public String getColor() {
52 | return color;
53 | }
54 |
55 | public void setColor(String color) {
56 | this.color = color;
57 | }
58 |
59 | public int getNumNotif() {
60 | return numNotif;
61 | }
62 |
63 | public void setNumNotif(int numNotif) {
64 | this.numNotif = numNotif;
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/app/src/main/java/com/artsystem/gmailapplocal/maillist/MailDiffUtilCallback.java:
--------------------------------------------------------------------------------
1 | package com.artsystem.gmailapplocal.maillist;
2 |
3 | import androidx.annotation.NonNull;
4 | import androidx.recyclerview.widget.DiffUtil;
5 |
6 | public class MailDiffUtilCallback extends DiffUtil.ItemCallback {
7 |
8 | @Override
9 | public boolean areItemsTheSame(@NonNull MailItem oldItem, @NonNull MailItem newItem) {
10 | return false;
11 | }
12 |
13 | @Override
14 | public boolean areContentsTheSame(@NonNull MailItem oldItem, @NonNull MailItem newItem) {
15 | return false;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/java/com/artsystem/gmailapplocal/maillist/MailItem.java:
--------------------------------------------------------------------------------
1 | package com.artsystem.gmailapplocal.maillist;
2 |
3 | import com.artsystem.gmailapplocal.data.Constant;
4 |
5 | public class MailItem {
6 |
7 | private MailCategoryItem categoryItem;
8 | private MailSimpleItem simpleItem;
9 |
10 | private int type;
11 |
12 | public MailItem(MailCategoryItem categoryItem) {
13 | this.categoryItem = categoryItem;
14 | type = Constant.MAIL_CATEGORY_TYPE;
15 | }
16 |
17 | public MailItem(MailSimpleItem simpleItem) {
18 | this.simpleItem = simpleItem;
19 | type = Constant.MAIL_ITEM_TYPE;
20 | }
21 |
22 | public MailCategoryItem getCategoryItem() {
23 | return categoryItem;
24 | }
25 |
26 | public void setCategoryItem(MailCategoryItem categoryItem) {
27 | this.categoryItem = categoryItem;
28 | }
29 |
30 | public MailSimpleItem getSimpleItem() {
31 | return simpleItem;
32 | }
33 |
34 | public void setSimpleItem(MailSimpleItem simpleItem) {
35 | this.simpleItem = simpleItem;
36 | }
37 |
38 | public int getType() {
39 | return type;
40 | }
41 |
42 | public void setType(int type) {
43 | this.type = type;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/app/src/main/java/com/artsystem/gmailapplocal/maillist/MailSimpleItem.java:
--------------------------------------------------------------------------------
1 | package com.artsystem.gmailapplocal.maillist;
2 |
3 | public class MailSimpleItem {
4 |
5 | private int id;
6 | private String title,content,description,sentMail,sentUserName;
7 | private int imgUrl;
8 | private boolean isFav = false,isRead=false;
9 |
10 |
11 | public MailSimpleItem() {
12 | }
13 |
14 | public MailSimpleItem(int id, String title, String content, String description, String sentMail, String sentUserName, int imgUrl) {
15 | this.id = id;
16 | this.title = title;
17 | this.content = content;
18 | this.description = description;
19 | this.sentMail = sentMail;
20 | this.sentUserName = sentUserName;
21 | this.imgUrl = imgUrl;
22 | }
23 |
24 | public MailSimpleItem(int id, String title, String content, String description, String sentMail, String sentUserName, int imgUrl,boolean isRead) {
25 | this.id = id;
26 | this.title = title;
27 | this.content = content;
28 | this.description = description;
29 | this.sentMail = sentMail;
30 | this.sentUserName = sentUserName;
31 | this.imgUrl = imgUrl;
32 | this.isRead = isRead;
33 | }
34 |
35 | public MailSimpleItem(int id, String title, String description, int imgUrl, String Contentz) {
36 | this.id = id;
37 | this.title = title;
38 | this.description = description;
39 | this.imgUrl = imgUrl;
40 | this.content = Contentz;
41 | }
42 |
43 |
44 | public MailSimpleItem(int id, String title, String description, int imgUrl, String Contentz,boolean isRead) {
45 | this.id = id;
46 | this.title = title;
47 | this.description = description;
48 | this.imgUrl = imgUrl;
49 | this.content = Contentz;
50 | this.isRead = isRead;
51 | }
52 |
53 | public MailSimpleItem(int id, String title, String description, int imgUrl, String Contentz,boolean isRead,boolean isFav) {
54 | this.id = id;
55 | this.title = title;
56 | this.description = description;
57 | this.imgUrl = imgUrl;
58 | this.content = Contentz;
59 | this.isRead = isRead;
60 | this.isFav = isFav;
61 | }
62 |
63 | public int getId() {
64 | return id;
65 | }
66 |
67 | public void setId(int id) {
68 | this.id = id;
69 | }
70 |
71 | public String getTitle() {
72 | return title;
73 | }
74 |
75 | public void setTitle(String title) {
76 | this.title = title;
77 | }
78 |
79 | public String getContent() {
80 | return content;
81 | }
82 |
83 | public void setContent(String content) {
84 | this.content = content;
85 | }
86 |
87 | public String getDescription() {
88 | return description;
89 | }
90 |
91 | public void setDescription(String description) {
92 | this.description = description;
93 | }
94 |
95 | public String getSentMail() {
96 | return sentMail;
97 | }
98 |
99 | public void setSentMail(String sentMail) {
100 | this.sentMail = sentMail;
101 | }
102 |
103 | public String getSentUserName() {
104 | return sentUserName;
105 | }
106 |
107 | public void setSentUserName(String sentUserName) {
108 | this.sentUserName = sentUserName;
109 | }
110 |
111 | public int getImgUrl() {
112 | return imgUrl;
113 | }
114 |
115 | public void setImgUrl(int imgUrl) {
116 | this.imgUrl = imgUrl;
117 | }
118 |
119 |
120 | public boolean isFav() {
121 | return isFav;
122 | }
123 |
124 | public void setFav(boolean fav) {
125 | isFav = fav;
126 | }
127 |
128 | public boolean isRead() {
129 | return isRead;
130 | }
131 |
132 | public void setRead(boolean read) {
133 | isRead = read;
134 | }
135 | }
136 |
--------------------------------------------------------------------------------
/app/src/main/java/com/artsystem/gmailapplocal/navigation/LabelItem.java:
--------------------------------------------------------------------------------
1 | package com.artsystem.gmailapplocal.navigation;
2 |
3 | public class LabelItem {
4 |
5 | private String label;
6 |
7 | public LabelItem(String label) {
8 | this.label = label;
9 | }
10 |
11 | public String getLabel() {
12 | return label;
13 | }
14 |
15 | public void setLabel(String label) {
16 | this.label = label;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/app/src/main/java/com/artsystem/gmailapplocal/navigation/MenuItem.java:
--------------------------------------------------------------------------------
1 | package com.artsystem.gmailapplocal.navigation;
2 |
3 | public class MenuItem {
4 |
5 | private int icon ;
6 | private String title;
7 | private boolean isSelected = false;
8 |
9 | public int getIcon() {
10 | return icon;
11 | }
12 |
13 | public void setIcon(int icon) {
14 | this.icon = icon;
15 | }
16 |
17 | public int getNumNotification() {
18 | return numNotification;
19 | }
20 |
21 | public void setNumNotification(int numNotification) {
22 | this.numNotification = numNotification;
23 | }
24 |
25 | private int numNotification = 0;
26 |
27 | public MenuItem(int drawable, String title, boolean isSelected) {
28 | this.icon = drawable;
29 | this.title = title;
30 | this.isSelected = isSelected;
31 | }
32 |
33 |
34 |
35 | public MenuItem(int icon, String title, boolean isSelected, int numNotification) {
36 | this.icon = icon;
37 | this.title = title;
38 | this.isSelected = isSelected;
39 | this.numNotification = numNotification;
40 | }
41 |
42 | public int getDrawable() {
43 | return icon;
44 | }
45 |
46 | public void setDrawable(int drawable) {
47 | this.icon = drawable;
48 | }
49 |
50 | public String getTitle() {
51 | return title;
52 | }
53 |
54 | public void setTitle(String title) {
55 | this.title = title;
56 | }
57 |
58 | public boolean isSelected() {
59 | return isSelected;
60 | }
61 |
62 | public void setSelected(boolean selected) {
63 | isSelected = selected;
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/app/src/main/java/com/artsystem/gmailapplocal/navigation/NavAdapter.java:
--------------------------------------------------------------------------------
1 | package com.artsystem.gmailapplocal.navigation;
2 |
3 | import android.graphics.Color;
4 | import android.graphics.drawable.ColorDrawable;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.ImageView;
9 | import android.widget.TextView;
10 |
11 | import androidx.annotation.NonNull;
12 | import androidx.constraintlayout.widget.ConstraintLayout;
13 | import androidx.recyclerview.widget.DiffUtil;
14 | import androidx.recyclerview.widget.ListAdapter;
15 | import androidx.recyclerview.widget.RecyclerView;
16 |
17 | import com.artsystem.gmailapplocal.R;
18 | import com.artsystem.gmailapplocal.data.Constant;
19 |
20 | public class NavAdapter extends ListAdapter {
21 |
22 |
23 | public NavAdapter(@NonNull DiffUtil.ItemCallback diffCallback) {
24 | super(diffCallback);
25 | }
26 |
27 | @NonNull
28 | @Override
29 | public NavBaseViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
30 |
31 |
32 | switch (viewType) {
33 | case Constant.NAV_MENU_TYPE:
34 | View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_nav_menu,parent,false);
35 | return new MenuViewHolder(v);
36 |
37 | case Constant.NAV_TEXT_TYPE:
38 | View v2 = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_nav_label,parent,false);
39 | return new LabelViewHolder(v2);
40 |
41 |
42 | default:
43 | View def = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_nav_label,parent,false);
44 | return new LabelViewHolder(def);
45 |
46 | }
47 | }
48 |
49 | @Override
50 | public void onBindViewHolder(@NonNull NavBaseViewHolder holder, int position) {
51 |
52 | holder.bindData(getItem(position));
53 |
54 | }
55 |
56 | @Override
57 | public int getItemViewType(int position) {
58 |
59 | return getItem(position).getType();
60 |
61 | }
62 |
63 | public abstract class NavBaseViewHolder extends RecyclerView.ViewHolder {
64 |
65 | public NavBaseViewHolder(@NonNull View itemView) {
66 | super(itemView);
67 | }
68 |
69 | abstract void bindData(NavItem item);
70 |
71 |
72 | }
73 |
74 | // Simple Label ViewHolder type class: extends BASEViewholder
75 | public class LabelViewHolder extends NavBaseViewHolder {
76 |
77 | TextView labelTv;
78 |
79 | public LabelViewHolder(@NonNull View itemView) {
80 | super(itemView);
81 | labelTv = itemView.findViewById(R.id.nav_label);
82 | }
83 |
84 | @Override
85 | void bindData(NavItem item) {
86 | labelTv.setText(item.getLabelItem().getLabel());
87 | }
88 | }
89 |
90 | // Menu Item ViewHolder type class: extends BASEViewHolder
91 | public class MenuViewHolder extends NavBaseViewHolder {
92 |
93 | TextView menuTitle,num;
94 | ImageView icon;
95 | ConstraintLayout container;
96 |
97 | public MenuViewHolder(@NonNull View itemView) {
98 | super(itemView);
99 | menuTitle = itemView.findViewById(R.id.nav_title);
100 | num = itemView.findViewById(R.id.nav_num);
101 | icon = itemView.findViewById(R.id.icon);
102 | container = itemView.findViewById(R.id.nav_item_container);
103 | }
104 |
105 | @Override
106 | void bindData(NavItem item) {
107 | menuTitle.setText(item.getMenuItem().getTitle());
108 | icon.setImageResource(item.getMenuItem().getIcon());
109 | if (item.getMenuItem().getNumNotification() != 0) {
110 | num.setVisibility(View.VISIBLE);
111 | num.setText(""+item.getMenuItem().getNumNotification());
112 | }
113 | if (item.getMenuItem().getNumNotification()>99) {
114 | num.setVisibility(View.VISIBLE);
115 | num.setText("+99");
116 | }
117 | else
118 | num.setVisibility(View.GONE);
119 |
120 | setSelected(item.getMenuItem().isSelected());
121 | }
122 |
123 | void setSelected(boolean isSelected) {
124 |
125 | if (isSelected) {
126 | container.setBackground(container.getContext().getResources().getDrawable(R.drawable.nav_select_bg));
127 | }
128 | else {
129 | container.setBackground(new ColorDrawable(Color.TRANSPARENT));
130 | }
131 | }
132 |
133 |
134 | }
135 |
136 | }
137 |
--------------------------------------------------------------------------------
/app/src/main/java/com/artsystem/gmailapplocal/navigation/NavItem.java:
--------------------------------------------------------------------------------
1 | package com.artsystem.gmailapplocal.navigation;
2 |
3 | import com.artsystem.gmailapplocal.data.Constant;
4 |
5 | public class NavItem {
6 |
7 |
8 |
9 | public NavItem(MenuItem menuItem) {
10 | this.menuItem = menuItem;
11 | type = Constant.NAV_MENU_TYPE;
12 | }
13 |
14 | public NavItem(LabelItem labelItem) {
15 | this.labelItem = labelItem;
16 | type = Constant.NAV_TEXT_TYPE;
17 | }
18 |
19 | private int type;
20 | private MenuItem menuItem;
21 | private LabelItem labelItem;
22 |
23 |
24 | public int getType() {
25 | return type;
26 | }
27 |
28 | public void setType(int type) {
29 | this.type = type;
30 | }
31 |
32 | public MenuItem getMenuItem() {
33 | return menuItem;
34 | }
35 |
36 | public void setMenuItem(MenuItem menuItem) {
37 | this.menuItem = menuItem;
38 | }
39 |
40 | public LabelItem getLabelItem() {
41 | return labelItem;
42 | }
43 |
44 | public void setLabelItem(LabelItem labelItem) {
45 | this.labelItem = labelItem;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/main/java/com/artsystem/gmailapplocal/navigation/NavMenuItemCallback.java:
--------------------------------------------------------------------------------
1 | package com.artsystem.gmailapplocal.navigation;
2 |
3 | import androidx.annotation.NonNull;
4 | import androidx.recyclerview.widget.DiffUtil;
5 |
6 | public class NavMenuItemCallback extends DiffUtil.ItemCallback {
7 | @Override
8 | public boolean areItemsTheSame(@NonNull NavItem oldItem, @NonNull NavItem newItem) {
9 | return false;
10 | }
11 |
12 | @Override
13 | public boolean areContentsTheSame(@NonNull NavItem oldItem, @NonNull NavItem newItem) {
14 | return false;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/app/src/main/java/com/artsystem/gmailapplocal/searchactivity/SearchActivity.java:
--------------------------------------------------------------------------------
1 | package com.artsystem.gmailapplocal.searchactivity;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.app.Activity;
6 | import android.content.Context;
7 | import android.graphics.Color;
8 | import android.os.Build;
9 | import android.os.Bundle;
10 | import android.view.View;
11 | import android.view.inputmethod.InputMethodManager;
12 | import android.widget.ArrayAdapter;
13 | import android.widget.EditText;
14 | import android.widget.ImageView;
15 | import android.widget.ListView;
16 |
17 | import com.artsystem.gmailapplocal.R;
18 |
19 | import java.util.ArrayList;
20 | import java.util.List;
21 |
22 | public class SearchActivity extends AppCompatActivity {
23 |
24 | EditText editSearch;
25 | ImageView closeImg;
26 | ListView listView;
27 |
28 | @Override
29 | protected void onCreate(Bundle savedInstanceState) {
30 |
31 | int selectedTheme = getIntent().getIntExtra("themeid",R.style.AppTheme);
32 | setTheme(selectedTheme);
33 | super.onCreate(savedInstanceState);
34 | setContentView(R.layout.activity_search);
35 | // if light theme is selected we change to light status bar
36 | if (selectedTheme == R.style.AppTheme) {
37 | setLightStatusBar(getWindow().getDecorView(),this);
38 | }
39 |
40 | setEditSearchFocus();
41 | setBackClickListener();
42 | setupSimpleSearchList();
43 |
44 |
45 | }
46 |
47 | private void setupSimpleSearchList() {
48 | listView = findViewById(R.id.lvSearch);
49 | listView.setDivider(null);
50 | List lst = new ArrayList<>();
51 | lst.add("Google Mail");
52 | lst.add("Anna Steve");
53 | lst.add("Microsoft Store ");
54 |
55 | ArrayAdapter adapter = new ArrayAdapter(this,R.layout.item_simple_search,R.id.searchtvshow,lst);
56 | listView.setAdapter(adapter);
57 |
58 | }
59 |
60 | private void setBackClickListener() {
61 | closeImg = findViewById(R.id.menu_icon);
62 | closeImg.setOnClickListener(new View.OnClickListener() {
63 | @Override
64 | public void onClick(View view) {
65 | closeKeyboard();
66 | onBackPressed();
67 | }
68 | });
69 | }
70 |
71 | private void openKeyboard(){
72 | InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
73 | imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);
74 | }
75 |
76 | private void closeKeyboard() {
77 | InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
78 | imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);
79 | }
80 |
81 | public static void setLightStatusBar(View view, Activity activity){
82 |
83 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
84 | int flags = view.getSystemUiVisibility();
85 | flags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
86 | view.setSystemUiVisibility(flags);
87 | activity.getWindow().setStatusBarColor(Color.WHITE);
88 | }
89 |
90 | }
91 |
92 | private void setEditSearchFocus(){
93 |
94 | editSearch = findViewById(R.id.eidtsearch);
95 | }
96 |
97 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/ic_menu_camera.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/ic_menu_gallery.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/ic_menu_slideshow.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/adobe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/drawable/adobe.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/androidstudio.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/drawable/androidstudio.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_cat_counter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_selected.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/girl0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/drawable/girl0.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/google.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/drawable/google.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_all_inbox_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_arrow_back_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_calendar_today_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_delete_outline_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_history_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_inbox_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_keyboard_voice_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_mail_outline_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_menu_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_person_outline_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_search_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_snooze_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_star_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_star_border_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_outline_account_circle_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_outline_create_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_outline_drafts_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_outline_forum_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_outline_info_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_outline_label_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_outline_local_offer_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_outline_send_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_outline_settings_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/nav_select_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/pnggoogle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/drawable/pnggoogle.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/side_nav_bar.xml:
--------------------------------------------------------------------------------
1 |
3 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/drawable/user.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/user2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/drawable/user2.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/user3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/drawable/user3.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/user4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/drawable/user4.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/user5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/drawable/user5.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/usernoimg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/drawable/usernoimg.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/usernoimg0.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/drawable/usernoimg0.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/usernoimg01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/drawable/usernoimg01.png
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
18 |
22 |
26 |
27 |
28 |
29 |
37 |
38 |
39 |
43 |
44 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
64 |
65 |
66 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_search.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
22 |
23 |
39 |
40 |
52 |
53 |
62 |
63 |
72 |
73 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_category.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
23 |
24 |
37 |
38 |
52 |
53 |
54 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_mail.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
22 |
23 |
36 |
37 |
51 |
52 |
67 |
68 |
81 |
82 |
93 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_nav_label.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_nav_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
24 |
25 |
36 |
37 |
49 |
50 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_simple_search.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
20 |
21 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/search_bar.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
14 |
15 |
26 |
27 |
41 |
42 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/activity_main_drawer.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/nav_test.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - Reply
5 | - Reply to all
6 |
7 |
8 |
9 | - reply
10 | - reply_all
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #ffffff
4 | #ffffff
5 | #03DAC5
6 |
7 |
8 |
9 |
10 |
11 | #B365F8
12 | #F96335
13 | #1E1E1E
14 | #008DFC
15 | #FCBF38
16 | #21A049
17 |
18 |
19 |
20 |
21 | #ffffff
22 | #202125
23 |
24 | #474747
25 | #e9eaee
26 |
27 | #ffffff
28 | #202125
29 |
30 | #ffffff
31 | #303135
32 |
33 | #000000
34 | #6F6F6F
35 | #ffffff
36 | #DADADA
37 |
38 | #ffffff
39 | #36373b
40 |
41 | #F44336
42 | #f28b82
43 |
44 |
45 |
46 |
47 | #2d2d2d
48 | #9D9D9D
49 |
50 |
51 |
52 |
53 |
54 | #F9F9F9
55 | #EEEEEE
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 8dp
6 | 176dp
7 | 16dp
8 |
--------------------------------------------------------------------------------
/app/src/main/res/values/drawables.xml:
--------------------------------------------------------------------------------
1 |
2 | - @android:drawable/ic_menu_camera
3 | - @android:drawable/ic_menu_gallery
4 | - @android:drawable/ic_menu_slideshow
5 | - @android:drawable/ic_menu_manage
6 | - @android:drawable/ic_menu_share
7 | - @android:drawable/ic_menu_send
8 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | GmailAppLocal
3 |
4 | Hello blank fragment
5 |
6 | Messages
7 | Sync
8 |
9 |
10 | Your signature
11 | Default reply action
12 |
13 |
14 | Sync email periodically
15 | Download incoming attachments
16 | Automatically download attachments for incoming emails
17 |
18 | Only download attachments when manually requested
19 | NavTestActivity
20 | Open navigation drawer
21 | Close navigation drawer
22 | Android Studio
23 | android.studio@android.com
24 | Navigation header
25 | Settings
26 |
27 | Home
28 | Gallery
29 | Slideshow
30 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
19 |
20 |
21 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/root_preferences.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
17 |
18 |
19 |
20 |
21 |
22 |
25 |
26 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/searchable.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/app/src/test/java/com/artsystem/gmailapplocal/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.artsystem.gmailapplocal;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | buildscript {
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath "com.android.tools.build:gradle:4.0.0"
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 | google()
18 | jcenter()
19 | }
20 | }
21 |
22 | task clean(type: Delete) {
23 | delete rootProject.buildDir
24 | }
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aws1994/GmailAppLocal/4971d04fc8982430e26b6a4e1ddfd99ca4920158/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Nov 11 13:06:53 PST 2020
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-6.1.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
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 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/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 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
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 Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | rootProject.name = "GmailAppLocal"
--------------------------------------------------------------------------------