Skip to content

Commit 7f9666e

Browse files
authored
Merge pull request #27 from SlaVcE14/dev
1.4 release
2 parents 28a3c5a + e291420 commit 7f9666e

69 files changed

Lines changed: 2816 additions & 402 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ "master" ]
16+
branches: [ "master", "dev" ]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ "master" ]
19+
branches: [ "master", "dev" ]
2020
schedule:
2121
- cron: '26 5 * * 0'
2222

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
1+
![repo preview](https://repository-images.githubusercontent.com/507594462/8b9d54af-1231-43e3-a84a-5d19da2e5e38)
12
# JsonList
2-
Android app for previewing JSON files in list form
3+
Introducing a Material You Android application for previewing JSON files in a user-friendly list format.
4+
5+
![JsonList](images/jsonlist_main.jpg)
6+
7+
Use the convenient split view feature that allows simultaneous display of the raw JSON string alongside the list representation.
8+
9+
![JsonList split view](images/jsonlist_splitview.jpg)
10+
11+
![JsonList split view landscape](images/jsonlist_splitview_landscape.jpg)
12+
13+
Enjoy the flexibility of dynamic color support, adapting to your Material Design preferences.
14+
15+
![JsonList dynamic colors](images/jsonlist_material_colots.gif)

app/build.gradle

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ plugins {
33
}
44

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

88
defaultConfig {
99
applicationId "com.sjapps.jsonlist"
1010
minSdk 23
11-
targetSdk 31
12-
versionCode 5
13-
versionName "1.3"
11+
targetSdk 34
12+
versionCode 10
13+
versionName "1.4"
1414

1515
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1616
}
@@ -22,7 +22,7 @@ android {
2222
}
2323
debug {
2424
applicationIdSuffix '.debug'
25-
versionNameSuffix ' debug'
25+
versionNameSuffix ' dev'
2626
}
2727
}
2828
compileOptions {
@@ -33,14 +33,15 @@ android {
3333

3434
dependencies {
3535

36-
implementation 'androidx.appcompat:appcompat:1.4.2'
37-
implementation 'com.google.android.material:material:1.6.1'
36+
implementation 'androidx.appcompat:appcompat:1.6.1'
37+
implementation 'com.google.android.material:material:1.12.0-alpha03'
3838
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
3939

4040
testImplementation 'junit:junit:4.+'
4141
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
4242
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
4343

44-
implementation 'com.google.code.gson:gson:2.8.9'
45-
implementation 'com.github.slavce14:SJ-Library:1.4'
44+
implementation 'com.google.code.gson:gson:2.10.1'
45+
implementation 'com.github.slavce14:sj-dialog:1.6.1'
46+
implementation "androidx.core:core-splashscreen:1.0.1"
4647
}

app/src/main/AndroidManifest.xml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="com.sjapps.jsonlist">
44

5+
<queries>
6+
<package android:name="com.sjapps.sjstore"/>
7+
</queries>
8+
59
<application
610
android:allowBackup="true"
711
android:name=".App"
@@ -12,14 +16,18 @@
1216
android:largeHeap="true"
1317
android:theme="@style/Theme.JsonList">
1418
<activity android:name="com.sjapps.about.AboutActivity"/>
19+
<activity
20+
android:name="com.sjapps.logs.LogActivity"
21+
android:exported="false" />
1522
<activity
1623
android:name=".MainActivity"
17-
android:configChanges="orientation|screenSize"
24+
android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout"
1825
android:exported="true">
1926
<meta-data android:name="android.app.shortcuts"
2027
android:resource="@xml/shortcuts" />
2128
<intent-filter>
2229
<action android:name="android.intent.action.MAIN" />
30+
<action android:name="android.intent.action.OPEN_DOCUMENT"/>
2331

2432
<category android:name="android.intent.category.LAUNCHER" />
2533
</intent-filter>
@@ -38,6 +46,16 @@
3846
<data android:scheme="content" />
3947
</intent-filter>
4048
</activity>
49+
50+
<provider
51+
android:authorities="${applicationId}.logs.provider"
52+
android:name="androidx.core.content.FileProvider"
53+
android:exported="false"
54+
android:grantUriPermissions="true">
55+
<meta-data
56+
android:name="android.support.FILE_PROVIDER_PATHS"
57+
android:resource="@xml/file_path"/>
58+
</provider>
4159
</application>
4260

4361
</manifest>
-6.68 KB
Binary file not shown.

app/src/main/java/com/sjapps/about/AboutActivity.java

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
import android.content.ComponentName;
44
import android.content.Intent;
55
import android.content.pm.ApplicationInfo;
6+
import android.content.pm.PackageInfo;
67
import android.content.pm.PackageManager;
8+
import android.graphics.drawable.Drawable;
9+
import android.net.Uri;
710
import android.os.Bundle;
811
import android.view.View;
912
import android.view.animation.Animation;
@@ -12,23 +15,29 @@
1215

1316
import androidx.annotation.NonNull;
1417
import androidx.appcompat.app.AppCompatActivity;
18+
import androidx.appcompat.content.res.AppCompatResources;
1519
import androidx.core.widget.NestedScrollView;
1620
import androidx.recyclerview.widget.LinearLayoutManager;
1721
import androidx.recyclerview.widget.RecyclerView;
1822

1923
import com.sjapps.jsonlist.R;
24+
import com.sjapps.library.customdialog.ImageListItem;
25+
import com.sjapps.library.customdialog.ListDialog;
2026

2127
import java.util.ArrayList;
2228

2329
public class AboutActivity extends AppCompatActivity {
2430

31+
private static final String GITHUB_REPOSITORY_RELEASES = "https://github.com/SlaVcE14/JsonList/releases";
2532
final String STORE_PACKAGE_NAME = "com.sjapps.sjstore";
2633

2734
ImageView logo;
2835
NestedScrollView nestedScrollView;
2936
RecyclerView ListRV,LibListRV;
3037
ArrayList<AboutListItem> appInfoItems = new ArrayList<>();
3138
ArrayList<AboutListItem> libsItems;
39+
boolean isStoreInstalled;
40+
Drawable storeIcon;
3241

3342
@Override
3443
protected void onCreate(Bundle savedInstanceState) {
@@ -69,24 +78,53 @@ void initialize(){
6978
ListRV = findViewById(R.id.aboutList);
7079
LibListRV = findViewById(R.id.LibrariesList);
7180
nestedScrollView = findViewById(R.id.nestedList);
72-
81+
findViewById(R.id.updateBtn).setVisibility(View.VISIBLE);
7382
if (CheckStoreIsInstalled()){
74-
findViewById(R.id.updateBtn).setVisibility(View.VISIBLE);
83+
isStoreInstalled = true;
7584
}
7685
}
7786

7887
public void CheckForUpdate(View view) {
88+
if (!isStoreInstalled) {
89+
openGitHub();
90+
return;
91+
}
92+
93+
ListDialog dialog = new ListDialog();
94+
95+
ArrayList<ImageListItem> items = new ArrayList<>();
96+
items.add(new ImageListItem("GitHub", AppCompatResources.getDrawable(this,R.drawable.github_logo), (ImageItemClick) this::openGitHub));
97+
items.add(new ImageListItem("SJ Store", storeIcon, (ImageItemClick) this::openStore));
98+
99+
dialog.Builder(this,true)
100+
.setTitle("Open...")
101+
.setImageItems(items, (position, obj) -> {
102+
if (obj.getData() == null)
103+
return;
104+
((ImageItemClick) obj.getData()).onClick();
105+
dialog.dismiss();
106+
})
107+
.show();
108+
}
109+
110+
private void openGitHub(){
111+
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(GITHUB_REPOSITORY_RELEASES));
112+
startActivity(intent);
113+
}
114+
115+
private void openStore(){
79116
Intent intent = new Intent();
80117
intent.setComponent(new ComponentName(STORE_PACKAGE_NAME,STORE_PACKAGE_NAME + ".AppActivity"));
81118
intent.putExtra("packageName", getPackageName());
82119
intent.putExtra("isInstalled",true);
83120
startActivity(intent);
84121
}
85122

86-
public boolean CheckStoreIsInstalled(){
123+
private boolean CheckStoreIsInstalled(){
87124
PackageManager packageManager = getPackageManager();
88125
try {
89-
packageManager.getPackageInfo(STORE_PACKAGE_NAME,0);
126+
PackageInfo packageInfo = packageManager.getPackageInfo(STORE_PACKAGE_NAME,0);
127+
storeIcon = packageInfo.applicationInfo.loadIcon(packageManager);
90128
return true;
91129
} catch (PackageManager.NameNotFoundException e) {
92130
return false;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.sjapps.about;
2+
3+
public interface ImageItemClick {
4+
void onClick();
5+
}
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
package com.sjapps.about;
22

3+
import com.google.gson.internal.GsonBuildConfig;
4+
import com.sjapps.library.BuildConfig;
5+
36
public class LibraryList extends ListGenerator{
47
@Override
58
public void init() {
6-
addItem("SJ Library","1.4", "https://github.com/SlaVcE14/SJ-Library");
7-
addItem("gson","2.8.9", "https://github.com/google/gson");
9+
addItem("SJ Dialog", BuildConfig.VERSION_NAME, "https://github.com/SlaVcE14/SJ-Dialog");
10+
addItem("gson", GsonBuildConfig.VERSION, "https://github.com/google/gson");
11+
addItem("core-splashscreen","1.0.1","https://developer.android.com/develop/ui/views/launch/splash-screen");
812
}
913
}
1014

0 commit comments

Comments
 (0)