├── .gitignore
├── .idea
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── gradle.xml
├── markdown-navigator.xml
├── markdown-navigator
│ └── profiles_settings.xml
├── misc.xml
├── modules.xml
├── runConfigurations.xml
└── vcs.xml
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── mani
│ │ └── rc
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── mani
│ │ │ └── rc
│ │ │ ├── CustomRunnable.java
│ │ │ ├── CustomTimer.java
│ │ │ ├── MainActivity.java
│ │ │ └── RecyclerViewAdapter.java
│ └── res
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── content_main.xml
│ │ └── recycler_item.xml
│ │ ├── menu
│ │ └── menu_main.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
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── mani
│ └── rc
│ └── ExampleUnitTest.java
├── art
├── Untitled.gif
├── device-2017-09-05-062715.png
└── device-2017-09-05-062727.png
├── build.gradle
├── circle.yml
├── fastlane
├── .gitignore
├── Appfile
└── Fastfile
├── 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/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | .externalNativeBuild
10 |
--------------------------------------------------------------------------------
/.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/markdown-navigator.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 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/.idea/markdown-navigator/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.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 | Android
39 |
40 |
41 | Android > Lint > Correctness
42 |
43 |
44 | Android > Lint > Correctness > Messages
45 |
46 |
47 | Android > Lint > Internationalization > Bidirectional Text
48 |
49 |
50 | Android > Lint > Lint
51 |
52 |
53 | Android > Lint > Performance
54 |
55 |
56 | Android > Lint > Usability
57 |
58 |
59 | Class structureJava
60 |
61 |
62 | CorrectnessLintAndroid
63 |
64 |
65 | Data flow issuesJava
66 |
67 |
68 | Declaration redundancyJava
69 |
70 |
71 | Dependency issuesJava
72 |
73 |
74 | Error handlingJava
75 |
76 |
77 | Groovy
78 |
79 |
80 | JUnit issuesJava
81 |
82 |
83 | Java
84 |
85 |
86 | LintAndroid
87 |
88 |
89 | Logging issuesJava
90 |
91 |
92 | Memory issuesJava
93 |
94 |
95 | Modularization issuesJava
96 |
97 |
98 | Packaging issuesJava
99 |
100 |
101 | Pattern Validation
102 |
103 |
104 | Portability issuesJava
105 |
106 |
107 | Potentially confusing code constructsGroovy
108 |
109 |
110 | Probable bugsJava
111 |
112 |
113 | Security issuesJava
114 |
115 |
116 | Serialization issuesJava
117 |
118 |
119 | Threading issuesGroovy
120 |
121 |
122 | Threading issuesJava
123 |
124 |
125 |
126 |
127 | Android
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 | 1.8
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # TimerInRecyclerView
2 | Handling multiple Countdown timers in Recyclerview
3 |
4 | [](https://dashboard.buddybuild.com/apps/59adee69eb2c3f00012303f4/build/latest?branch=master)
5 |
6 | Inspired from various SO questions,
7 |
8 | [Recyclerview with multiple countdown timers causes flickering] (https://stackoverflow.com/questions/35860780/recyclerview-with-multiple-countdown-timers-causes-flickering)
9 |
10 | [Multiple count down timers in RecyclerView flickering when scrolled] (https://stackoverflow.com/questions/38890863/multiple-count-down-timers-in-recyclerview-flickering-when-scrolled)
11 |
12 | [How to handle multiple countdown timers in RecyclerView?] (https://stackoverflow.com/questions/32257586/how-to-handle-multiple-countdown-timers-in-recyclerview)
13 |
14 | and
15 | [Handling countdown timers in recyclerview - android] (https://stackoverflow.com/questions/38241539/handling-countdown-timers-in-recyclerview-android)
16 |
17 |
18 | # Screenshots
19 |
20 |
21 |
22 | # App Performance
23 |
24 |
25 |
26 | # What does this app do?
27 | The aim of the project is to showcase how to handle multiple timer inside the recyclerview and how to clean up the resource.
28 |
29 | # How does app do?
30 | Instead of CountdownTimer/TimerTask app performs count down operation using Runnable and handler.
31 |
32 | # Reasoning
33 | Motivation of the application is to have individual timer for each row, however recycle the timer as same logic as view recycling,
34 | so that there won't be peak memory usage and leading to impact on performance.
35 |
36 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 26
5 | buildToolsVersion "26.0.1"
6 | defaultConfig {
7 | applicationId "com.mani.rc"
8 | minSdkVersion 15
9 | targetSdkVersion 26
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
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 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
25 | exclude group: 'com.android.support', module: 'support-annotations'
26 | })
27 | compile 'com.android.support:appcompat-v7:26.+'
28 | compile 'com.android.support.constraint:constraint-layout:1.0.2'
29 | compile 'com.android.support:design:26.+'
30 | testCompile 'junit:junit:4.12'
31 | compile 'com.jakewharton:butterknife:8.8.1'
32 | annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
33 | }
34 |
--------------------------------------------------------------------------------
/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/manikkumarkumaravel/Downloads/android-sdk-macosx/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 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/mani/rc/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.mani.rc;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest {
18 | @Test public void useAppContext() throws Exception {
19 | // Context of the app under test.
20 | Context appContext = InstrumentationRegistry.getTargetContext();
21 |
22 | assertEquals("com.mani.rc", appContext.getPackageName());
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/java/com/mani/rc/CustomRunnable.java:
--------------------------------------------------------------------------------
1 | package com.mani.rc;
2 |
3 | import android.os.Handler;
4 | import android.util.Log;
5 | import android.widget.ImageView;
6 | import android.widget.TextView;
7 |
8 | public class CustomRunnable implements Runnable {
9 |
10 | public long millisUntilFinished = 40000;
11 | public TextView holder;
12 | Handler handler;
13 | ImageView imageView;
14 |
15 | public CustomRunnable(Handler handler,TextView holder,long millisUntilFinished,ImageView imageView) {
16 | this.handler = handler;
17 | this.holder = holder;
18 | this.millisUntilFinished = millisUntilFinished;
19 | this.imageView = imageView;
20 | }
21 |
22 | @Override
23 | public void run() {
24 | /* do what you need to do */
25 | long seconds = millisUntilFinished / 1000;
26 | long minutes = seconds / 60;
27 | long hours = minutes / 60;
28 | long days = hours / 24;
29 | String time = days+" "+"days" +" :" +hours % 24 + ":" + minutes % 60 + ":" + seconds % 60;
30 | holder.setText(time);
31 |
32 | millisUntilFinished -= 1000;
33 |
34 | Log.d("DEV123",time);
35 | imageView.setX(imageView.getX()+seconds);
36 | /* and here comes the "trick" */
37 | handler.postDelayed(this, 1000);
38 | }
39 |
40 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/mani/rc/CustomTimer.java:
--------------------------------------------------------------------------------
1 | package com.mani.rc;
2 |
3 | /**
4 | * Created by mani on 03/09/17.
5 | */
6 |
7 | class CustomTimer {
8 | public long startTime;
9 | }
10 |
--------------------------------------------------------------------------------
/app/src/main/java/com/mani/rc/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.mani.rc;
2 |
3 | import android.os.Bundle;
4 | import android.os.CountDownTimer;
5 | import android.os.Handler;
6 | import android.support.design.widget.FloatingActionButton;
7 | import android.support.design.widget.Snackbar;
8 | import android.support.v7.app.AppCompatActivity;
9 | import android.support.v7.widget.RecyclerView;
10 | import android.support.v7.widget.Toolbar;
11 | import android.util.Log;
12 | import android.view.View;
13 | import android.view.Menu;
14 | import android.view.MenuItem;
15 | import android.view.ViewGroup;
16 | import android.widget.TextView;
17 | import butterknife.BindView;
18 | import butterknife.ButterKnife;
19 |
20 | public class MainActivity extends AppCompatActivity {
21 |
22 | TextView holder,holderOne,holderTwo;
23 | //CountDownTimer countDownTimer;
24 |
25 | @BindView(R.id.recycler) RecyclerView recyclerView;
26 | RecyclerViewAdapter recyclerViewAdapter;
27 | @Override protected void onCreate(Bundle savedInstanceState) {
28 | super.onCreate(savedInstanceState);
29 | setContentView(R.layout.activity_main);
30 | ButterKnife.bind(this);
31 |
32 | /* holder = (TextView) findViewById(R.id.timestamp);
33 | holderOne = (TextView) findViewById(R.id.timestamp_one);
34 | holderTwo = (TextView) findViewById(R.id.timestamp_two);*/
35 |
36 | recyclerViewAdapter = new RecyclerViewAdapter(getApplicationContext(),null,null);
37 | recyclerView.setAdapter(recyclerViewAdapter);
38 |
39 | /*countDownTimer = new CustomTimer(10000, 500);
40 | final CustomRunnable customRunnable = new CustomRunnable();
41 | final CustomRunnable customRunnableOne = new CustomRunnable();
42 | final CustomRunnable customRunnableTwo = new CustomRunnable();
43 |
44 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
45 |
46 | fab.setOnClickListener(new View.OnClickListener() {
47 | @Override public void onClick(View view) {
48 |
49 | //countDownTimer.start();
50 |
51 | handler.removeCallbacks(customRunnable);
52 | customRunnable.holder = holder;
53 | customRunnable.millisUntilFinished = 4000; //Current time - received time
54 | handler.postDelayed(customRunnable, 100);
55 |
56 |
57 | handler.removeCallbacks(customRunnableOne);
58 | customRunnableOne.holder = holderOne;
59 | customRunnableOne.millisUntilFinished = 50000; //Current time - received time
60 | handler.postDelayed(customRunnableOne, 100);
61 |
62 |
63 | handler.removeCallbacks(customRunnableTwo);
64 | customRunnableTwo.holder = holderTwo;
65 | customRunnableTwo.millisUntilFinished = 99000; //Current time - received time
66 | handler.postDelayed(customRunnableTwo, 100);
67 | }
68 | });*/
69 | }
70 |
71 | @Override protected void onPause() {
72 | super.onPause();
73 | //countDownTimer.cancel();
74 | /*handler.removeCallbacksAndMessages(null);
75 | holder = null;*/
76 | recyclerViewAdapter.clearAll();
77 | }
78 |
79 |
80 | /*private Handler handler = new Handler();
81 |
82 | public class CustomRunnable implements Runnable {
83 |
84 | public long millisUntilFinished = 40000;
85 | public TextView holder;
86 |
87 | @Override
88 | public void run() {
89 | *//* do what you need to do *//*
90 | long seconds = millisUntilFinished / 1000;
91 | long minutes = seconds / 60;
92 | long hours = minutes / 60;
93 | long days = hours / 24;
94 | String time = days+" "+"days" +" :" +hours % 24 + ":" + minutes % 60 + ":" + seconds % 60;
95 | holder.setText(time);
96 |
97 | millisUntilFinished -= 1000;
98 |
99 | Log.d("DEV123",time);
100 |
101 | *//* and here comes the "trick" *//*
102 | handler.postDelayed(this, 1000);
103 | }
104 |
105 | }
106 |
107 | public class CustomTimer extends CountDownTimer{
108 |
109 | public CustomTimer(long millisInFuture, long countDownInterval) {
110 | super(millisInFuture, countDownInterval);
111 | Log.d("DEV123","Creating new object");
112 | }
113 |
114 | public void onTick(long millisUntilFinished) {
115 | long seconds = millisUntilFinished / 1000;
116 | long minutes = seconds / 60;
117 | long hours = minutes / 60;
118 | long days = hours / 24;
119 | String time = days+" "+"days" +" :" +hours % 24 + ":" + minutes % 60 + ":" + seconds % 60;
120 | holder.setText(time);
121 |
122 | Log.d("DEV123",time);
123 | }
124 |
125 | public void onFinish() {
126 | holder.setText("Time up!");
127 | }
128 | }*/
129 | }
130 |
--------------------------------------------------------------------------------
/app/src/main/java/com/mani/rc/RecyclerViewAdapter.java:
--------------------------------------------------------------------------------
1 | package com.mani.rc;/**
2 | * Created by mani on 03/09/17.
3 | */
4 |
5 | import android.content.Context;
6 | import android.os.CountDownTimer;
7 | import android.os.Handler;
8 | import android.support.v7.widget.RecyclerView;
9 | import android.util.Log;
10 | import android.view.LayoutInflater;
11 | import android.view.View;
12 | import android.view.ViewGroup;
13 |
14 | import android.widget.ImageView;
15 | import android.widget.TextView;
16 | import butterknife.BindView;
17 | import java.util.List;
18 |
19 | import butterknife.ButterKnife;
20 |
21 | public class RecyclerViewAdapter extends RecyclerView.Adapter {
22 |
23 | private static final String TAG = RecyclerViewAdapter.class.getSimpleName();
24 |
25 | private Context context;
26 | private List list;
27 | private OnItemClickListener onItemClickListener;
28 | private Handler handler = new Handler();
29 |
30 | public RecyclerViewAdapter(Context context, List list,
31 | OnItemClickListener onItemClickListener) {
32 | this.context = context;
33 | this.list = list;
34 | this.onItemClickListener = onItemClickListener;
35 | }
36 |
37 | public void clearAll() {
38 | handler.removeCallbacksAndMessages(null);
39 | }
40 |
41 | public class ViewHolder extends RecyclerView.ViewHolder {
42 | // Todo Butterknife bindings
43 | @BindView(R.id.timestamp) TextView timeStamp;
44 | @BindView(R.id.bck) ImageView imageView;
45 | CustomRunnable customRunnable;
46 |
47 | public ViewHolder(View itemView) {
48 | super(itemView);
49 | ButterKnife.bind(this, itemView);
50 | customRunnable = new CustomRunnable(handler,timeStamp,10000,imageView);
51 | }
52 |
53 | public void bind(final CustomTimer model, final OnItemClickListener listener) {
54 | /*itemView.setOnClickListener(new View.OnClickListener() {
55 | @Override public void onClick(View v) {
56 | listener.onItemClick(getLayoutPosition());
57 | }
58 | });*/
59 |
60 | handler.removeCallbacks(customRunnable);
61 | customRunnable.holder = timeStamp;
62 | customRunnable.millisUntilFinished = 10000 * getAdapterPosition(); //Current time - received time
63 | handler.postDelayed(customRunnable, 100);
64 |
65 | }
66 | }
67 |
68 |
69 |
70 |
71 | @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
72 | Context context = parent.getContext();
73 | LayoutInflater inflater = LayoutInflater.from(context);
74 |
75 | View view = inflater.inflate(R.layout.recycler_item, parent, false);
76 | ButterKnife.bind(this, view);
77 |
78 | ViewHolder viewHolder = new ViewHolder(view);
79 |
80 | return viewHolder;
81 | }
82 |
83 | @Override public void onBindViewHolder(ViewHolder holder, int position) {
84 | //CustomTimer item = list.get(position);
85 |
86 | //Todo: Setup viewholder for item
87 | holder.bind(null, onItemClickListener);
88 | }
89 |
90 | @Override public int getItemCount() {
91 | return 100;//list.size();
92 | }
93 |
94 | public interface OnItemClickListener {
95 | void onItemClick(int position);
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
28 |
29 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/content_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/recycler_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
12 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Manikkumar1988/TimerInRecyclerView/4d17da178d2d3a02621366eb1483e6a74ba72aed/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Manikkumar1988/TimerInRecyclerView/4d17da178d2d3a02621366eb1483e6a74ba72aed/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Manikkumar1988/TimerInRecyclerView/4d17da178d2d3a02621366eb1483e6a74ba72aed/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Manikkumar1988/TimerInRecyclerView/4d17da178d2d3a02621366eb1483e6a74ba72aed/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Manikkumar1988/TimerInRecyclerView/4d17da178d2d3a02621366eb1483e6a74ba72aed/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Manikkumar1988/TimerInRecyclerView/4d17da178d2d3a02621366eb1483e6a74ba72aed/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Manikkumar1988/TimerInRecyclerView/4d17da178d2d3a02621366eb1483e6a74ba72aed/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Manikkumar1988/TimerInRecyclerView/4d17da178d2d3a02621366eb1483e6a74ba72aed/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Manikkumar1988/TimerInRecyclerView/4d17da178d2d3a02621366eb1483e6a74ba72aed/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Manikkumar1988/TimerInRecyclerView/4d17da178d2d3a02621366eb1483e6a74ba72aed/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 16dp
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | RecyclerViewTimer
3 | Settings
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/test/java/com/mani/rc/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.mani.rc;
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 public void addition_isCorrect() throws Exception {
14 | assertEquals(4, 2 + 2);
15 | }
16 | }
--------------------------------------------------------------------------------
/art/Untitled.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Manikkumar1988/TimerInRecyclerView/4d17da178d2d3a02621366eb1483e6a74ba72aed/art/Untitled.gif
--------------------------------------------------------------------------------
/art/device-2017-09-05-062715.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Manikkumar1988/TimerInRecyclerView/4d17da178d2d3a02621366eb1483e6a74ba72aed/art/device-2017-09-05-062715.png
--------------------------------------------------------------------------------
/art/device-2017-09-05-062727.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Manikkumar1988/TimerInRecyclerView/4d17da178d2d3a02621366eb1483e6a74ba72aed/art/device-2017-09-05-062727.png
--------------------------------------------------------------------------------
/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:2.3.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 |
21 | task clean(type: Delete) {
22 | delete rootProject.buildDir
23 | }
24 |
--------------------------------------------------------------------------------
/circle.yml:
--------------------------------------------------------------------------------
1 | #
2 | # Build configuration for Circle CI
3 | #
4 | # See this thread for speeding up and caching directories: https://discuss.circleci.com/t/installing-android-build-tools-23-0-2/924
5 | #
6 |
7 | general:
8 | artifacts:
9 | - /home/ubuntu/circleci-integration/app/build/outputs/apk/
10 |
11 | machine:
12 | environment:
13 | ANDROID_HOME: /usr/local/android-sdk-linux
14 |
15 |
16 | dependencies:
17 | pre:
18 | - if [ ! -e /usr/local/android-sdk-linux/build-tools/26.0.1 ]; then echo y | android update sdk --all --no-ui --filter "build-tools-26.0.1"; fi;
19 | - if [ ! -e /usr/local/android-sdk-linux/platforms/android-26 ]; then echo y | android update sdk --all --no-ui --filter "android-26"; fi;
20 | - if ! $(grep -q "Revision=45.0.0" /usr/local/android-sdk-linux/extras/android/m2repository/source.properties); then echo y | android update sdk --all --no-ui --filter "extra-android-m2repository"; fi;
21 | - echo y | android update sdk --no-ui --all --filter "tool,extra-android-m2repository,extra-android-support,extra-google-google_play_services,extra-google-m2repository"
22 | - echo y | /usr/local/android-sdk-linux/tools/bin/sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2"
23 | cache_directories:
24 | - /usr/local/android-sdk-linux/build-tools/26.0.1
25 | - /usr/local/android-sdk-linux/platforms/android-26
26 | - /usr/local/android-sdk-linux/extras/android/m2repository
27 | override:
28 | - chmod +x ./gradlew
29 |
30 | test:
31 | override:
32 | - ./gradlew assemble
33 | - cp -r app/build/outputs $CIRCLE_ARTIFACTS
34 |
--------------------------------------------------------------------------------
/fastlane/.gitignore:
--------------------------------------------------------------------------------
1 | installer/
2 |
--------------------------------------------------------------------------------
/fastlane/Appfile:
--------------------------------------------------------------------------------
1 | # The Appfile can be used to specify information that's used across all fastlane
2 | # tools, like your username or the app's bundle identifier.
3 | #
4 | # For more details, check out the documentation at:
5 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Appfile.md
6 |
7 | # app_identifier "com.your.app" # the bundle identifier of your app
8 | # apple_id "apple@fastlane.tools" # Your Apple ID
9 |
--------------------------------------------------------------------------------
/fastlane/Fastfile:
--------------------------------------------------------------------------------
1 | # More documentation about how to customize your build
2 | # can be found here:
3 | # https://docs.fastlane.tools
4 | fastlane_version "1.109.0"
5 |
6 | # This value helps us track success metrics for Fastfiles
7 | # we automatically generate. Feel free to remove this line
8 | # once you get things running smoothly!
9 | generated_fastfile_id "28b6d16c-2808-4bda-b486-5e6b83de9ef2"
10 |
11 | default_platform :android
12 |
13 | # Fastfile actions accept additional configuration, but
14 | # don't worry, fastlane will prompt you for required
15 | # info which you can add here later
16 | lane :beta do
17 | # build the release variant
18 | gradle(task: "assembleRelease")
19 |
20 | # upload to Beta by Crashlytics
21 | crashlytics(
22 | api_token: "8c5129c2e78aac330db4577170707615bcde23b5",
23 | build_secret: "e62aeeae55baa5afe06bc595e6a570bad408b940765e62275675638d79960aeb"
24 | )
25 | end
26 |
--------------------------------------------------------------------------------
/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 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Manikkumar1988/TimerInRecyclerView/4d17da178d2d3a02621366eb1483e6a74ba72aed/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Sep 03 16:44:03 IST 2017
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-3.3-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 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------