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 ece3082b..069b2e1e 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.AppThemeLight); + setTheme(R.style.AppTheme); super.onCreate(savedInstanceState); setContentView(getLayoutResourceId()); diff --git a/app/src/main/java/org/mian/gitnex/activities/CreateTeamByOrgActivity.java b/app/src/main/java/org/mian/gitnex/activities/CreateTeamByOrgActivity.java index 0ba362ca..8d86e082 100644 --- a/app/src/main/java/org/mian/gitnex/activities/CreateTeamByOrgActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/CreateTeamByOrgActivity.java @@ -2,7 +2,6 @@ package org.mian.gitnex.activities; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; -import androidx.appcompat.app.AppCompatActivity; import retrofit2.Call; import retrofit2.Callback; import android.content.Context; @@ -30,7 +29,7 @@ import android.util.Log; * Author M M Arif */ -public class CreateTeamByOrgActivity extends AppCompatActivity implements View.OnClickListener { +public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClickListener { final Context ctx = CreateTeamByOrgActivity.this; private View.OnClickListener onClickListener; @@ -44,6 +43,11 @@ public class CreateTeamByOrgActivity extends AppCompatActivity implements View.O private String[] permissionList = {"Read", "Write", "Admin"}; public int permissionSelectedChoice = -1; + @Override + protected int getLayoutResourceId(){ + return R.layout.activity_create_team_by_org; + } + private String[] accessControlsList = new String[] { "Code", "Issues", @@ -67,9 +71,8 @@ public class CreateTeamByOrgActivity extends AppCompatActivity implements View.O }; @Override - protected void onCreate(Bundle savedInstanceState) { + public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.activity_create_team_by_org); boolean connToInternet = AppUtil.haveNetworkConnection(getApplicationContext()); @@ -89,7 +92,7 @@ public class CreateTeamByOrgActivity extends AppCompatActivity implements View.O @Override public void onClick(View view) { - AlertDialog.Builder pBuilder = new AlertDialog.Builder(ctx, R.style.confirmDialog); + AlertDialog.Builder pBuilder = new AlertDialog.Builder(ctx); pBuilder.setTitle(R.string.newTeamPermission); if(permissionSelectedChoice != -1) { @@ -141,7 +144,7 @@ public class CreateTeamByOrgActivity extends AppCompatActivity implements View.O teamAccessControlsArray.setText(""); pushAccessList = Arrays.asList(accessControlsList); - AlertDialog.Builder aDialogBuilder = new AlertDialog.Builder(ctx, R.style.confirmDialog); + AlertDialog.Builder aDialogBuilder = new AlertDialog.Builder(ctx); aDialogBuilder.setMultiChoiceItems(accessControlsList, selectedAccessControlsTrueFalse, new DialogInterface.OnMultiChoiceClickListener() { diff --git a/app/src/main/java/org/mian/gitnex/activities/CreditsActivity.java b/app/src/main/java/org/mian/gitnex/activities/CreditsActivity.java index 9c3bddb7..695113c0 100644 --- a/app/src/main/java/org/mian/gitnex/activities/CreditsActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/CreditsActivity.java @@ -1,6 +1,5 @@ package org.mian.gitnex.activities; -import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -18,15 +17,19 @@ import java.util.List; * Author M M Arif */ -public class CreditsActivity extends AppCompatActivity { +public class CreditsActivity extends BaseActivity { private View.OnClickListener onClickListener; @Override - protected void onCreate(Bundle savedInstanceState) { + protected int getLayoutResourceId(){ + return R.layout.activity_credits; + } + + @Override + public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.activity_credits); ImageView closeActivity = findViewById(R.id.close); diff --git a/app/src/main/java/org/mian/gitnex/activities/LoginActivity.java b/app/src/main/java/org/mian/gitnex/activities/LoginActivity.java index 2c858632..76eecc7d 100644 --- a/app/src/main/java/org/mian/gitnex/activities/LoginActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/LoginActivity.java @@ -403,7 +403,7 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener return; case UNSUPPORTED_OLD: - AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(ctx, R.style.confirmDialog); + AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(ctx); alertDialogBuilder .setTitle(getString(R.string.versionAlertDialogHeader)) diff --git a/app/src/main/java/org/mian/gitnex/activities/SponsorsActivity.java b/app/src/main/java/org/mian/gitnex/activities/SponsorsActivity.java index 4acf0279..84d0b357 100644 --- a/app/src/main/java/org/mian/gitnex/activities/SponsorsActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/SponsorsActivity.java @@ -1,6 +1,5 @@ package org.mian.gitnex.activities; -import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -18,14 +17,18 @@ import java.util.List; * Author M M Arif */ -public class SponsorsActivity extends AppCompatActivity { +public class SponsorsActivity extends BaseActivity { private View.OnClickListener onClickListener; @Override - protected void onCreate(Bundle savedInstanceState) { + protected int getLayoutResourceId(){ + return R.layout.activity_sponsors; + } + + @Override + public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.activity_sponsors); ImageView closeActivity = findViewById(R.id.close); diff --git a/app/src/main/java/org/mian/gitnex/adapters/ExploreRepositoriesAdapter.java b/app/src/main/java/org/mian/gitnex/adapters/ExploreRepositoriesAdapter.java index 70cace46..240a8421 100644 --- a/app/src/main/java/org/mian/gitnex/adapters/ExploreRepositoriesAdapter.java +++ b/app/src/main/java/org/mian/gitnex/adapters/ExploreRepositoriesAdapter.java @@ -90,9 +90,9 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter + android:background="?attr/primaryBackgroundColor"> @@ -52,7 +52,7 @@ android:id="@+id/recyclerView" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/colorPrimary" + android:background="?attr/primaryBackgroundColor" android:padding="4dp" android:scrollbars="vertical" /> diff --git a/app/src/main/res/layout/activity_sponsors.xml b/app/src/main/res/layout/activity_sponsors.xml index 30f1cbfc..7078ab9f 100644 --- a/app/src/main/res/layout/activity_sponsors.xml +++ b/app/src/main/res/layout/activity_sponsors.xml @@ -5,7 +5,7 @@ xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android" - android:background="@color/colorPrimary"> + android:background="?attr/primaryBackgroundColor"> @@ -52,7 +52,7 @@ android:id="@+id/recyclerView" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/colorPrimary" + android:background="?attr/primaryBackgroundColor" android:padding="4dp" android:scrollbars="vertical" /> diff --git a/app/src/main/res/layout/credits.xml b/app/src/main/res/layout/credits.xml index 2c2b1749..00f39d97 100644 --- a/app/src/main/res/layout/credits.xml +++ b/app/src/main/res/layout/credits.xml @@ -7,14 +7,14 @@ android:paddingTop="10dp" android:paddingStart="20dp" android:paddingEnd="20dp" - android:background="@color/backgroundColor" > + android:background="?attr/primaryBackgroundColor" > diff --git a/app/src/main/res/layout/sponsors.xml b/app/src/main/res/layout/sponsors.xml index 7820d034..6982208c 100644 --- a/app/src/main/res/layout/sponsors.xml +++ b/app/src/main/res/layout/sponsors.xml @@ -7,14 +7,14 @@ android:paddingTop="10dp" android:paddingStart="20dp" android:paddingEnd="20dp" - android:background="@color/backgroundColor" > + android:background="?attr/primaryBackgroundColor" > diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index aa54a526..7035e28e 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -5,4 +5,5 @@ + \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index ea5c013e..f4fc7905 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -19,22 +19,7 @@ - @@ -20,6 +23,7 @@ @color/colorPrimary @color/lightThemeBackground monospace + @color/colorAccent @color/lightThemeTextColor @color/lightThemeBackground @@ -27,6 +31,42 @@ @color/lightThemeInputTextColor @style/AppThemeLightCheckBoxStyle @color/darkGreen + @style/AppThemeLightConfirmDialog + @style/AppThemePopupMenuStyle + + + + + + + + +