From 1008b8611d885cbfe3845dda5ad40b8eb5ab9ac9 Mon Sep 17 00:00:00 2001 From: M M Arif Date: Wed, 4 Mar 2020 19:54:21 +0500 Subject: [PATCH] Added custom attr to more files --- .../java/org/mian/gitnex/activities/BaseActivity.java | 2 +- .../java/org/mian/gitnex/activities/MainActivity.java | 2 +- .../gitnex/activities/RepoStargazersActivity.java | 11 +++++++---- .../mian/gitnex/activities/RepoWatchersActivity.java | 11 +++++++---- .../mian/gitnex/adapters/RepoStargazersAdapter.java | 4 ++-- .../org/mian/gitnex/adapters/RepoWatchersAdapter.java | 4 ++-- .../org/mian/gitnex/fragments/SettingsFragment.java | 2 +- app/src/main/res/layout/activity_repo_stargazers.xml | 8 ++++---- app/src/main/res/layout/activity_repo_watchers.xml | 8 ++++---- app/src/main/res/layout/collaborators_list.xml | 4 ++-- app/src/main/res/layout/fragment_collaborators.xml | 4 ++-- app/src/main/res/layout/repo_stargazers_list.xml | 4 ++-- app/src/main/res/layout/repo_watchers_list.xml | 4 ++-- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 15 files changed, 40 insertions(+), 34 deletions(-) diff --git a/app/src/main/java/org/mian/gitnex/activities/BaseActivity.java b/app/src/main/java/org/mian/gitnex/activities/BaseActivity.java index 069b2e1e..ece3082b 100644 --- a/app/src/main/java/org/mian/gitnex/activities/BaseActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/BaseActivity.java @@ -15,7 +15,7 @@ public abstract class BaseActivity extends AppCompatActivity { @Override public void onCreate(Bundle savedInstanceState) { - setTheme(R.style.AppTheme); + setTheme(R.style.AppThemeLight); super.onCreate(savedInstanceState); setContentView(getLayoutResourceId()); diff --git a/app/src/main/java/org/mian/gitnex/activities/MainActivity.java b/app/src/main/java/org/mian/gitnex/activities/MainActivity.java index 8b258efc..9c56a19e 100644 --- a/app/src/main/java/org/mian/gitnex/activities/MainActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/MainActivity.java @@ -410,7 +410,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig } @Override - public void onFailure(@NonNull Call callVersion, Throwable t) { + public void onFailure(@NonNull Call callVersion, @NonNull Throwable t) { Log.e("onFailure-version", t.toString()); diff --git a/app/src/main/java/org/mian/gitnex/activities/RepoStargazersActivity.java b/app/src/main/java/org/mian/gitnex/activities/RepoStargazersActivity.java index 661e5ba1..f70f2eac 100644 --- a/app/src/main/java/org/mian/gitnex/activities/RepoStargazersActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/RepoStargazersActivity.java @@ -2,7 +2,6 @@ package org.mian.gitnex.activities; import android.os.Bundle; import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProvider; import android.view.View; @@ -22,7 +21,7 @@ import java.util.List; * Author M M Arif */ -public class RepoStargazersActivity extends AppCompatActivity { +public class RepoStargazersActivity extends BaseActivity { private TextView noDataStargazers; private View.OnClickListener onClickListener; @@ -31,9 +30,13 @@ public class RepoStargazersActivity extends AppCompatActivity { private ProgressBar mProgressBar; @Override - protected void onCreate(Bundle savedInstanceState) { + protected int getLayoutResourceId(){ + return R.layout.activity_repo_stargazers; + } + + @Override + public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.activity_repo_stargazers); TinyDB tinyDb = new TinyDB(getApplicationContext()); final String instanceUrl = tinyDb.getString("instanceUrl"); diff --git a/app/src/main/java/org/mian/gitnex/activities/RepoWatchersActivity.java b/app/src/main/java/org/mian/gitnex/activities/RepoWatchersActivity.java index e3e6afb8..a1f44076 100644 --- a/app/src/main/java/org/mian/gitnex/activities/RepoWatchersActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/RepoWatchersActivity.java @@ -2,7 +2,6 @@ package org.mian.gitnex.activities; import android.os.Bundle; import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatActivity; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProvider; import android.view.View; @@ -22,7 +21,7 @@ import java.util.List; * Author M M Arif */ -public class RepoWatchersActivity extends AppCompatActivity { +public class RepoWatchersActivity extends BaseActivity { private TextView noDataWatchers; private View.OnClickListener onClickListener; @@ -31,9 +30,13 @@ public class RepoWatchersActivity extends AppCompatActivity { private ProgressBar mProgressBar; @Override - protected void onCreate(Bundle savedInstanceState) { + protected int getLayoutResourceId(){ + return R.layout.activity_repo_watchers; + } + + @Override + public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.activity_repo_watchers); TinyDB tinyDb = new TinyDB(getApplicationContext()); final String instanceUrl = tinyDb.getString("instanceUrl"); diff --git a/app/src/main/java/org/mian/gitnex/adapters/RepoStargazersAdapter.java b/app/src/main/java/org/mian/gitnex/adapters/RepoStargazersAdapter.java index 9dacfe95..9d195090 100644 --- a/app/src/main/java/org/mian/gitnex/adapters/RepoStargazersAdapter.java +++ b/app/src/main/java/org/mian/gitnex/adapters/RepoStargazersAdapter.java @@ -25,7 +25,7 @@ public class RepoStargazersAdapter extends BaseAdapter { private List stargazersList; private Context mCtx; - private class ViewHolder { + private static class ViewHolder { private ImageView memberAvatar; private TextView memberName; @@ -64,7 +64,7 @@ public class RepoStargazersAdapter extends BaseAdapter { if (finalView == null) { finalView = LayoutInflater.from(mCtx).inflate(R.layout.repo_stargazers_list, null); - viewHolder = new RepoStargazersAdapter.ViewHolder(finalView); + viewHolder = new ViewHolder(finalView); finalView.setTag(viewHolder); } else { diff --git a/app/src/main/java/org/mian/gitnex/adapters/RepoWatchersAdapter.java b/app/src/main/java/org/mian/gitnex/adapters/RepoWatchersAdapter.java index 478ef19e..11304210 100644 --- a/app/src/main/java/org/mian/gitnex/adapters/RepoWatchersAdapter.java +++ b/app/src/main/java/org/mian/gitnex/adapters/RepoWatchersAdapter.java @@ -25,7 +25,7 @@ public class RepoWatchersAdapter extends BaseAdapter { private List watchersList; private Context mCtx; - private class ViewHolder { + private static class ViewHolder { private ImageView memberAvatar; private TextView memberName; @@ -64,7 +64,7 @@ public class RepoWatchersAdapter extends BaseAdapter { if (finalView == null) { finalView = LayoutInflater.from(mCtx).inflate(R.layout.repo_watchers_list, null); - viewHolder = new RepoWatchersAdapter.ViewHolder(finalView); + viewHolder = new ViewHolder(finalView); finalView.setTag(viewHolder); } else { diff --git a/app/src/main/java/org/mian/gitnex/fragments/SettingsFragment.java b/app/src/main/java/org/mian/gitnex/fragments/SettingsFragment.java index 69c116ec..32ce439a 100644 --- a/app/src/main/java/org/mian/gitnex/fragments/SettingsFragment.java +++ b/app/src/main/java/org/mian/gitnex/fragments/SettingsFragment.java @@ -140,7 +140,7 @@ public class SettingsFragment extends Fragment { @Override public void onClick(View view) { - AlertDialog.Builder cfBuilder = new AlertDialog.Builder(ctx, R.style.AppThemeLightConfirmDialog); + AlertDialog.Builder cfBuilder = new AlertDialog.Builder(ctx); cfBuilder.setTitle(R.string.settingsCustomFontSelectorDialogTitle); if(customFontSelectedChoice != -1) { diff --git a/app/src/main/res/layout/activity_repo_stargazers.xml b/app/src/main/res/layout/activity_repo_stargazers.xml index e1b407eb..47136de5 100644 --- a/app/src/main/res/layout/activity_repo_stargazers.xml +++ b/app/src/main/res/layout/activity_repo_stargazers.xml @@ -3,7 +3,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/colorPrimary" + android:background="?attr/primaryBackgroundColor" android:orientation="vertical"> @@ -58,7 +58,7 @@ android:layout_margin="15dp" android:gravity="center" android:text="@string/noDataFound" - android:textColor="@color/white" + android:textColor="?attr/primaryTextColor" android:textSize="20sp" android:visibility="gone" /> diff --git a/app/src/main/res/layout/activity_repo_watchers.xml b/app/src/main/res/layout/activity_repo_watchers.xml index 57e98d4e..641b75e4 100644 --- a/app/src/main/res/layout/activity_repo_watchers.xml +++ b/app/src/main/res/layout/activity_repo_watchers.xml @@ -3,7 +3,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/colorPrimary" + android:background="?attr/primaryBackgroundColor" android:orientation="vertical"> @@ -58,7 +58,7 @@ android:layout_margin="15dp" android:gravity="center" android:text="@string/noDataFound" - android:textColor="@color/white" + android:textColor="?attr/primaryTextColor" android:textSize="20sp" android:visibility="gone" /> diff --git a/app/src/main/res/layout/collaborators_list.xml b/app/src/main/res/layout/collaborators_list.xml index 962c826f..f945cc02 100644 --- a/app/src/main/res/layout/collaborators_list.xml +++ b/app/src/main/res/layout/collaborators_list.xml @@ -4,7 +4,7 @@ android:id="@+id/gridViewData" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/colorPrimary" + android:background="?attr/primaryBackgroundColor" android:orientation="vertical"> + android:textColor="?attr/primaryTextColor" /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_collaborators.xml b/app/src/main/res/layout/fragment_collaborators.xml index 76f6e6e1..86826ef1 100644 --- a/app/src/main/res/layout/fragment_collaborators.xml +++ b/app/src/main/res/layout/fragment_collaborators.xml @@ -2,7 +2,7 @@ diff --git a/app/src/main/res/layout/repo_stargazers_list.xml b/app/src/main/res/layout/repo_stargazers_list.xml index b71a03fc..407417fb 100644 --- a/app/src/main/res/layout/repo_stargazers_list.xml +++ b/app/src/main/res/layout/repo_stargazers_list.xml @@ -4,7 +4,7 @@ android:id="@+id/gridViewData" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/colorPrimary" + android:background="?attr/primaryBackgroundColor" android:orientation="vertical"> + android:textColor="?attr/primaryTextColor" /> \ No newline at end of file diff --git a/app/src/main/res/layout/repo_watchers_list.xml b/app/src/main/res/layout/repo_watchers_list.xml index 78904d5d..33d74779 100644 --- a/app/src/main/res/layout/repo_watchers_list.xml +++ b/app/src/main/res/layout/repo_watchers_list.xml @@ -4,7 +4,7 @@ android:id="@+id/gridViewData" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/colorPrimary" + android:background="?attr/primaryBackgroundColor" android:orientation="vertical"> + android:textColor="?attr/primaryTextColor" /> \ No newline at end of file diff --git a/build.gradle b/build.gradle index 623f86d8..9aea99c1 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.3' + classpath 'com.android.tools.build:gradle:3.6.1' } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e2b44955..3a2ffa5a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Sep 12 16:12:36 SGT 2019 +#Wed Mar 04 00:16:50 SGT 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip