Skip to content

Commit

Permalink
Merge pull request #27 from SlaVcE14/dev
Browse files Browse the repository at this point in the history
1.4 release
  • Loading branch information
SlaVcE14 authored Feb 10, 2024
2 parents 28a3c5a + e291420 commit 7f9666e
Show file tree
Hide file tree
Showing 69 changed files with 2,816 additions and 402 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ name: "CodeQL"

on:
push:
branches: [ "master" ]
branches: [ "master", "dev" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
branches: [ "master", "dev" ]
schedule:
- cron: '26 5 * * 0'

Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
![repo preview](https://repository-images.githubusercontent.com/507594462/8b9d54af-1231-43e3-a84a-5d19da2e5e38)
# JsonList
Android app for previewing JSON files in list form
Introducing a Material You Android application for previewing JSON files in a user-friendly list format.

![JsonList](images/jsonlist_main.jpg)

Use the convenient split view feature that allows simultaneous display of the raw JSON string alongside the list representation.

![JsonList split view](images/jsonlist_splitview.jpg)

![JsonList split view landscape](images/jsonlist_splitview_landscape.jpg)

Enjoy the flexibility of dynamic color support, adapting to your Material Design preferences.

![JsonList dynamic colors](images/jsonlist_material_colots.gif)
19 changes: 10 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ plugins {
}

android {
compileSdk 31
compileSdk 34

defaultConfig {
applicationId "com.sjapps.jsonlist"
minSdk 23
targetSdk 31
versionCode 5
versionName "1.3"
targetSdk 34
versionCode 10
versionName "1.4"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -22,7 +22,7 @@ android {
}
debug {
applicationIdSuffix '.debug'
versionNameSuffix ' debug'
versionNameSuffix ' dev'
}
}
compileOptions {
Expand All @@ -33,14 +33,15 @@ android {

dependencies {

implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.12.0-alpha03'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

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

implementation 'com.google.code.gson:gson:2.8.9'
implementation 'com.github.slavce14:SJ-Library:1.4'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'com.github.slavce14:sj-dialog:1.6.1'
implementation "androidx.core:core-splashscreen:1.0.1"
}
20 changes: 19 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sjapps.jsonlist">

<queries>
<package android:name="com.sjapps.sjstore"/>
</queries>

<application
android:allowBackup="true"
android:name=".App"
Expand All @@ -12,14 +16,18 @@
android:largeHeap="true"
android:theme="@style/Theme.JsonList">
<activity android:name="com.sjapps.about.AboutActivity"/>
<activity
android:name="com.sjapps.logs.LogActivity"
android:exported="false" />
<activity
android:name=".MainActivity"
android:configChanges="orientation|screenSize"
android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout"
android:exported="true">
<meta-data android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.OPEN_DOCUMENT"/>

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Expand All @@ -38,6 +46,16 @@
<data android:scheme="content" />
</intent-filter>
</activity>

<provider
android:authorities="${applicationId}.logs.provider"
android:name="androidx.core.content.FileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_path"/>
</provider>
</application>

</manifest>
Binary file removed app/src/main/ic_open_file-playstore.png
Binary file not shown.
46 changes: 42 additions & 4 deletions app/src/main/java/com/sjapps/about/AboutActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
Expand All @@ -12,23 +15,29 @@

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.widget.NestedScrollView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.sjapps.jsonlist.R;
import com.sjapps.library.customdialog.ImageListItem;
import com.sjapps.library.customdialog.ListDialog;

import java.util.ArrayList;

public class AboutActivity extends AppCompatActivity {

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

ImageView logo;
NestedScrollView nestedScrollView;
RecyclerView ListRV,LibListRV;
ArrayList<AboutListItem> appInfoItems = new ArrayList<>();
ArrayList<AboutListItem> libsItems;
boolean isStoreInstalled;
Drawable storeIcon;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -69,24 +78,53 @@ void initialize(){
ListRV = findViewById(R.id.aboutList);
LibListRV = findViewById(R.id.LibrariesList);
nestedScrollView = findViewById(R.id.nestedList);

findViewById(R.id.updateBtn).setVisibility(View.VISIBLE);
if (CheckStoreIsInstalled()){
findViewById(R.id.updateBtn).setVisibility(View.VISIBLE);
isStoreInstalled = true;
}
}

public void CheckForUpdate(View view) {
if (!isStoreInstalled) {
openGitHub();
return;
}

ListDialog dialog = new ListDialog();

ArrayList<ImageListItem> items = new ArrayList<>();
items.add(new ImageListItem("GitHub", AppCompatResources.getDrawable(this,R.drawable.github_logo), (ImageItemClick) this::openGitHub));
items.add(new ImageListItem("SJ Store", storeIcon, (ImageItemClick) this::openStore));

dialog.Builder(this,true)
.setTitle("Open...")
.setImageItems(items, (position, obj) -> {
if (obj.getData() == null)
return;
((ImageItemClick) obj.getData()).onClick();
dialog.dismiss();
})
.show();
}

private void openGitHub(){
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(GITHUB_REPOSITORY_RELEASES));
startActivity(intent);
}

private void openStore(){
Intent intent = new Intent();
intent.setComponent(new ComponentName(STORE_PACKAGE_NAME,STORE_PACKAGE_NAME + ".AppActivity"));
intent.putExtra("packageName", getPackageName());
intent.putExtra("isInstalled",true);
startActivity(intent);
}

public boolean CheckStoreIsInstalled(){
private boolean CheckStoreIsInstalled(){
PackageManager packageManager = getPackageManager();
try {
packageManager.getPackageInfo(STORE_PACKAGE_NAME,0);
PackageInfo packageInfo = packageManager.getPackageInfo(STORE_PACKAGE_NAME,0);
storeIcon = packageInfo.applicationInfo.loadIcon(packageManager);
return true;
} catch (PackageManager.NameNotFoundException e) {
return false;
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/java/com/sjapps/about/ImageItemClick.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.sjapps.about;

public interface ImageItemClick {
void onClick();
}
8 changes: 6 additions & 2 deletions app/src/main/java/com/sjapps/about/LibraryList.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package com.sjapps.about;

import com.google.gson.internal.GsonBuildConfig;
import com.sjapps.library.BuildConfig;

public class LibraryList extends ListGenerator{
@Override
public void init() {
addItem("SJ Library","1.4", "https://github.com/SlaVcE14/SJ-Library");
addItem("gson","2.8.9", "https://github.com/google/gson");
addItem("SJ Dialog", BuildConfig.VERSION_NAME, "https://github.com/SlaVcE14/SJ-Dialog");
addItem("gson", GsonBuildConfig.VERSION, "https://github.com/google/gson");
addItem("core-splashscreen","1.0.1","https://developer.android.com/develop/ui/views/launch/splash-screen");
}
}

Loading

0 comments on commit 7f9666e

Please sign in to comment.