Skip to content

Commit 026b139

Browse files
committed
update gradle, fix issue
fix all the dependency of gradle, go to the previous commit and update the repo
1 parent 4e0b13a commit 026b139

16 files changed

+73
-130
lines changed

.idea/compiler.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

+12-18
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ plugins {
33
}
44

55
android {
6-
compileSdk 31
6+
compileSdk 33
77

88
defaultConfig {
99
applicationId "com.aniketjain.patternprogramsinjava"
1010
minSdk 21
11-
targetSdk 31
11+
targetSdk 33
1212
versionCode 13
1313
versionName "1.1.3"
1414

@@ -17,7 +17,7 @@ android {
1717

1818
buildTypes {
1919
release {
20-
minifyEnabled false
20+
minifyEnabled true
2121
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
2222
}
2323
}
@@ -28,26 +28,20 @@ android {
2828
}
2929

3030
dependencies {
31+
implementation 'androidx.appcompat:appcompat:1.6.1'
32+
implementation 'com.google.android.material:material:1.9.0'
33+
testImplementation 'junit:junit:4.13.2'
34+
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
35+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
3136

32-
implementation 'androidx.appcompat:appcompat:1.4.0'
33-
implementation 'com.google.android.material:material:1.4.0'
34-
//noinspection GradleDynamicVersion
35-
testImplementation 'junit:junit:4.+'
36-
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
37-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
38-
39-
//Java Viewer
37+
// Java Viewer
4038
implementation 'io.github.Rosemoe.sora-editor:editor:0.8.4'
4139
implementation 'io.github.Rosemoe.sora-editor:language-java:0.8.4'
4240

4341
//PhotoView
4442
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
4543

46-
//Glide
47-
implementation 'com.github.bumptech.glide:glide:4.12.0'
48-
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
49-
50-
//App Auto Update Feature
51-
implementation 'com.google.android.play:core:1.10.2'
52-
44+
// Glide
45+
implementation 'com.github.bumptech.glide:glide:4.13.0'
46+
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.0'
5347
}

app/src/main/java/com/aniketjain/patternprogramsinjava/SelectionActivity.java

+47-92
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22

33
import android.annotation.SuppressLint;
44
import android.content.Intent;
5-
import android.content.IntentSender;
65
import android.net.Uri;
76
import android.os.Bundle;
87
import android.os.Handler;
98
import android.os.Looper;
109
import android.view.Menu;
1110
import android.view.MenuItem;
12-
import android.view.View;
1311

1412
import androidx.annotation.NonNull;
1513
import androidx.appcompat.app.ActionBarDrawerToggle;
@@ -21,12 +19,6 @@
2119
import androidx.recyclerview.widget.RecyclerView;
2220

2321
import com.google.android.material.navigation.NavigationView;
24-
import com.google.android.play.core.appupdate.AppUpdateInfo;
25-
import com.google.android.play.core.appupdate.AppUpdateManager;
26-
import com.google.android.play.core.appupdate.AppUpdateManagerFactory;
27-
import com.google.android.play.core.install.model.AppUpdateType;
28-
import com.google.android.play.core.install.model.UpdateAvailability;
29-
import com.google.android.play.core.tasks.Task;
3022

3123
import java.util.ArrayList;
3224
import java.util.Objects;
@@ -38,18 +30,12 @@ public class SelectionActivity extends AppCompatActivity {
3830

3931
boolean doubleBackToExitPressedOnce = false;
4032

41-
//for checking the app version, if the version is old then it will show the pop-up update message to the user.
42-
private AppUpdateManager appUpdateManager;
43-
private final int PATTERN_PROGRAMS_IN_JAVA_APP_UPDATE_REQ_CODE = 1008;
44-
33+
@SuppressLint("NonConstantResourceId")
4534
@Override
4635
protected void onCreate(Bundle savedInstanceState) {
4736
super.onCreate(savedInstanceState);
4837
setContentView(R.layout.activity_selection);
4938

50-
//for checking update.
51-
PopUpAppUpdate();
52-
5339
//FindViews
5440
RecyclerView selection_recyclerView = findViewById(R.id.selection_recycler);
5541
drawerLayout = findViewById(R.id.drawer_layout);
@@ -68,66 +54,57 @@ protected void onCreate(Bundle savedInstanceState) {
6854
Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true);
6955

7056
//set toolbar nav btn click
71-
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
72-
@Override
73-
public void onClick(View v) {
74-
drawerLayout.openDrawer(GravityCompat.START);
75-
}
76-
});
57+
toolbar.setNavigationOnClickListener(v -> drawerLayout.openDrawer(GravityCompat.START));
7758

7859
//default set checked
7960
nav.setCheckedItem(R.id.home);
8061
//set navigation
81-
nav.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
82-
@SuppressLint("NonConstantResourceId")
83-
@Override
84-
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
85-
Intent intent;
86-
Uri uri;
87-
switch (item.getItemId()) {
88-
case R.id.pattern1:
89-
intent = new Intent(SelectionActivity.this, QuestionsActivity.class);
90-
intent.putExtra("heading", "Star Pattern Programs")
91-
.putExtra("value", 1);
92-
startActivity(intent);
93-
break;
94-
case R.id.pattern2:
95-
intent = new Intent(SelectionActivity.this, QuestionsActivity.class);
96-
intent.putExtra("heading", "Number Pattern Programs")
97-
.putExtra("value", 2);
98-
startActivity(intent);
99-
break;
100-
case R.id.pattern3:
101-
intent = new Intent(SelectionActivity.this, QuestionsActivity.class);
102-
intent.putExtra("heading", "Alphabet Pattern Programs")
103-
.putExtra("value", 3);
104-
startActivity(intent);
105-
break;
106-
case R.id.share:
107-
intent = new Intent(Intent.ACTION_SEND);
108-
intent.setType("text/plain");
109-
String shareBody = "I'm using " + getString(R.string.app_name) + " App for creating amazing java patterns, try this App.\nDownload link - https://play.google.com/store/apps/details?id=" + getPackageName();
110-
String shareSubject = String.valueOf(R.string.app_name);
111-
intent.putExtra(Intent.EXTRA_TEXT, shareBody);
112-
intent.putExtra(Intent.EXTRA_SUBJECT, shareSubject);
113-
startActivity(Intent.createChooser(intent, "Share using"));
114-
break;
115-
case R.id.rate_us:
116-
uri = Uri.parse("http://play.google.com/store/apps/details?id=" + getPackageName());
117-
intent = new Intent(Intent.ACTION_VIEW, uri);
118-
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
119-
startActivity(intent);
120-
break;
121-
case R.id.more_apps:
122-
uri = Uri.parse("https://play.google.com/store/search?q=pub%3AAniket%20Jain&c=apps");
123-
intent = new Intent(Intent.ACTION_VIEW, uri);
124-
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
125-
startActivity(intent);
126-
break;
127-
}
128-
drawerLayout.closeDrawer(GravityCompat.START);
129-
return true;
62+
nav.setNavigationItemSelectedListener(item -> {
63+
Intent intent;
64+
Uri uri;
65+
switch (item.getItemId()) {
66+
case R.id.pattern1:
67+
intent = new Intent(SelectionActivity.this, QuestionsActivity.class);
68+
intent.putExtra("heading", "Star Pattern Programs")
69+
.putExtra("value", 1);
70+
startActivity(intent);
71+
break;
72+
case R.id.pattern2:
73+
intent = new Intent(SelectionActivity.this, QuestionsActivity.class);
74+
intent.putExtra("heading", "Number Pattern Programs")
75+
.putExtra("value", 2);
76+
startActivity(intent);
77+
break;
78+
case R.id.pattern3:
79+
intent = new Intent(SelectionActivity.this, QuestionsActivity.class);
80+
intent.putExtra("heading", "Alphabet Pattern Programs")
81+
.putExtra("value", 3);
82+
startActivity(intent);
83+
break;
84+
case R.id.share:
85+
intent = new Intent(Intent.ACTION_SEND);
86+
intent.setType("text/plain");
87+
String shareBody = "I'm using " + getString(R.string.app_name) + " App for creating amazing java patterns, try this App.\nDownload link - https://play.google.com/store/apps/details?id=" + getPackageName();
88+
String shareSubject = String.valueOf(R.string.app_name);
89+
intent.putExtra(Intent.EXTRA_TEXT, shareBody);
90+
intent.putExtra(Intent.EXTRA_SUBJECT, shareSubject);
91+
startActivity(Intent.createChooser(intent, "Share using"));
92+
break;
93+
case R.id.rate_us:
94+
uri = Uri.parse("http://play.google.com/store/apps/details?id=" + getPackageName());
95+
intent = new Intent(Intent.ACTION_VIEW, uri);
96+
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
97+
startActivity(intent);
98+
break;
99+
case R.id.more_apps:
100+
uri = Uri.parse("https://play.google.com/store/search?q=pub%3AAniket%20Jain&c=apps");
101+
intent = new Intent(Intent.ACTION_VIEW, uri);
102+
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
103+
startActivity(intent);
104+
break;
130105
}
106+
drawerLayout.closeDrawer(GravityCompat.START);
107+
return true;
131108
});
132109

133110
//Adding Selection Array Elements
@@ -183,26 +160,4 @@ public void onBackPressed() {
183160
doubleBackToExitPressedOnce = true;
184161
new Handler(Looper.getMainLooper()).postDelayed(() -> doubleBackToExitPressedOnce = false, 2000);
185162
}
186-
187-
private void PopUpAppUpdate() {
188-
appUpdateManager = AppUpdateManagerFactory.create(this);
189-
190-
// Returns an intent object that you use to check for an update.
191-
Task<AppUpdateInfo> appUpdateInfoTask = appUpdateManager.getAppUpdateInfo();
192-
193-
// Checks that the platform will allow the specified type of update.
194-
appUpdateInfoTask.addOnSuccessListener(appUpdateInfo -> {
195-
if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE
196-
// This example applies an immediate update. To apply a flexible update
197-
// instead, pass in AppUpdateType.IMMEDIATE
198-
&& appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.IMMEDIATE)) {
199-
// Request the update.
200-
try {
201-
appUpdateManager.startUpdateFlowForResult(appUpdateInfo, AppUpdateType.IMMEDIATE, SelectionActivity.this, PATTERN_PROGRAMS_IN_JAVA_APP_UPDATE_REQ_CODE);
202-
} catch (IntentSender.SendIntentException exception) {
203-
exception.printStackTrace();
204-
}
205-
}
206-
});
207-
}
208163
}

app/src/main/java/com/aniketjain/patternprogramsinjava/SplashScreenActivity.java

-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ protected void onCreate(Bundle savedInstanceState) {
1616
setContentView(R.layout.activity_splash_screen);
1717

1818
splash_screen_anim();
19-
2019
}
2120

2221
void splash_screen_anim() {
@@ -26,5 +25,4 @@ void splash_screen_anim() {
2625
SplashScreenActivity.this.startActivity(intent);
2726
}, 1000);
2827
}
29-
3028
}

app/src/main/res/layout/activity_selection.xml

-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
android:layout_height="wrap_content"
2828
android:layout_below="@id/main_toolbar"
2929
android:orientation="vertical" />
30-
3130
</RelativeLayout>
3231

3332
<com.google.android.material.navigation.NavigationView
@@ -38,5 +37,4 @@
3837
app:itemIconTint="@color/cyan_50"
3938
app:itemTextColor="@color/nav_text_color"
4039
app:menu="@menu/nav_menu" />
41-
4240
</androidx.drawerlayout.widget.DrawerLayout>

app/src/main/res/layout/activity_splash_screen.xml

-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@
1919
android:src="@drawable/app_logo_1024x1024"
2020
tools:ignore="ContentDescription" />
2121
</androidx.cardview.widget.CardView>
22-
2322
</RelativeLayout>

app/src/main/res/layout/full_view_activity.xml

-1
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,4 @@
8888
android:textSize="19sp"
8989
tools:ignore="HardcodedText" />
9090
</RelativeLayout>
91-
9291
</RelativeLayout>

app/src/main/res/layout/questions_activity.xml

-1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,4 @@
2424
android:layout_height="wrap_content"
2525
android:layout_below="@id/heading_textView"
2626
android:orientation="vertical" />
27-
2827
</RelativeLayout>

app/src/main/res/layout/selection_layout.xml

-1
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,4 @@
6262

6363
</RelativeLayout>
6464
</androidx.cardview.widget.CardView>
65-
6665
</androidx.cardview.widget.CardView>

app/src/main/res/values/colors.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
<color name="cyan_60">#33adff</color>
1717
<color name="cyan_70">#66c2ff</color>
1818
<color name="white_90">#e6e6e6</color>
19-
20-
<color name="nav_text_color">#232323</color>
2119

20+
<color name="nav_text_color">#232323</color>
2221
</resources>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3-
<color name="ic_main_background">#0066FF</color>
3+
<color name="ic_main_background">#33adff</color>
44
</resources>

app/src/main/res/values/strings.xml

-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,4 @@
44
<!-- Nav String -->
55
<string name="nav_open">Open</string>
66
<string name="nav_close">Close</string>
7-
8-
<!-- Admob Banner Id -->
9-
<string name="banner_ad_unit_id">ca-app-pub-9518849653601742/9756701443</string>
107
</resources>

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
maven { url 'https://jitpack.io' }
77
}
88
dependencies {
9-
classpath "com.android.tools.build:gradle:7.0.4"
9+
classpath 'com.android.tools.build:gradle:7.4.2'
1010

1111
// NOTE: Do not place your application dependencies here; they belong
1212
// in the individual module build.gradle files
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Sun Nov 21 01:00:13 IST 2021
1+
#Sat Jul 08 15:17:53 IST 2023
22
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
43
distributionPath=wrapper/dists
5-
zipStorePath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
65
zipStoreBase=GRADLE_USER_HOME
6+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)