Theme and Icons #260

Merged
mmarif merged 15 commits from light-theme into master 2020-03-08 13:52:34 +00:00
15 changed files with 40 additions and 34 deletions
Showing only changes of commit 1008b8611d - Show all commits

View File

@ -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);
Outdated
Review

can you test for == 1 and else set default theme?

can you test for == 1 and else set default theme?

Yes, that will work too.

Yes, that will work too.
setContentView(getLayoutResourceId());

View File

@ -410,7 +410,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
}
@Override
public void onFailure(@NonNull Call<GiteaVersion> callVersion, Throwable t) {
public void onFailure(@NonNull Call<GiteaVersion> callVersion, @NonNull Throwable t) {
Log.e("onFailure-version", t.toString());

View File

@ -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");

View File

@ -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");

View File

@ -25,7 +25,7 @@ public class RepoStargazersAdapter extends BaseAdapter {
private List<UserInfo> 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 {

View File

@ -25,7 +25,7 @@ public class RepoWatchersAdapter extends BaseAdapter {
private List<UserInfo> 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 {

View File

@ -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) {

View File

@ -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">
<com.google.android.material.appbar.AppBarLayout
@ -14,7 +14,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:background="?attr/primaryBackgroundColor"
tools:ignore="UnusedAttribute">
<ImageView
@ -32,7 +32,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textColor="@color/white"
android:textColor="?attr/primaryTextColor"
android:maxLines="1"
android:textSize="20sp" />
@ -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" />

View File

@ -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">
<com.google.android.material.appbar.AppBarLayout
@ -14,7 +14,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:background="?attr/primaryBackgroundColor"
tools:ignore="UnusedAttribute">
<ImageView
@ -32,7 +32,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textColor="@color/white"
android:textColor="?attr/primaryTextColor"
android:maxLines="1"
android:textSize="20sp" />
@ -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" />

View File

@ -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">
<ImageView
@ -22,6 +22,6 @@
android:layout_marginTop="1dp"
android:text="@string/tab_text_collaborators"
android:textSize="14sp"
android:textColor="@color/white" />
android:textColor="?attr/primaryTextColor" />
</LinearLayout>

View File

@ -2,7 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical">
<GridView
@ -23,7 +23,7 @@
android:layout_margin="15dp"
android:gravity="center"
android:text="@string/noDataCollaboratorTab"
android:textColor="@color/white"
android:textColor="?attr/primaryTextColor"
android:textSize="20sp"
android:visibility="gone" />

View File

@ -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">
<ImageView
@ -22,6 +22,6 @@
android:layout_marginTop="1dp"
android:text="@string/starMember"
android:textSize="14sp"
android:textColor="@color/white" />
android:textColor="?attr/primaryTextColor" />
</LinearLayout>

View File

@ -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">
<ImageView
@ -22,6 +22,6 @@
android:layout_marginTop="1dp"
android:text="@string/watcherMember"
android:textSize="14sp"
android:textColor="@color/white" />
android:textColor="?attr/primaryTextColor" />
</LinearLayout>

View File

@ -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'
}
}

View File

@ -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