Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update project in general #12

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

# indent_size = 4
14 changes: 3 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# IntelliJ IDEA
.idea
.idea/
*.iml
classes

# Gradle
.gradle
build
.gradle/
build/
local.properties

*~
ndk.bin
android-ndk-r10e/
16 changes: 10 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[submodule "pngquant-android/src/main/jni/pngquant"]
path = pngquant-android/src/main/jni/pngquant
url = https://github.com/pornel/pngquant.git
[submodule "pngquant-android/src/main/jni/libpng-android"]
path = pngquant-android/src/main/jni/libpng-android
url = https://github.com/julienr/libpng-android.git
#[submodule "pngquant-android/src/main/jni/pngquant-android"]
# path = pngquant-android/src/main/jni/pngquant-android
# url = https://github.com/wrmndfzzy/pngquant-android.git

#[submodule "pngquant-android/src/main/jni/libpng-android"]
# path = pngquant-android/src/main/jni/libpng-android
# url = https://github.com/julienr/libpng-android.git
#[submodule "pngquant-android/src/main/jni/pngquant"]
# path = pngquant-android/src/main/jni/pngquant
# url = https://github.com/pornel/pngquant.git
1 change: 0 additions & 1 deletion app/.gitignore

This file was deleted.

87 changes: 51 additions & 36 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,36 +1,51 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 26
defaultConfig {
applicationId "com.wrmndfzzy.atomize"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {

}
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:26.+'
implementation 'com.android.support:design:26.+'
testImplementation 'junit:junit:4.12'
implementation project(':pngquant-android')
implementation 'id.zelory:compressor:1.0.3'
implementation 'com.github.paolorotolo:appintro:3.4.0'
implementation 'us.feras.mdv:markdownview:1.1.0'
}
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
buildToolsVersion "29.0.3"

defaultConfig {
applicationId "com.wrmndfzzy.atomize"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

compileOptions {
encoding = 'UTF-8'
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

lintOptions {
disable 'GoogleAppIndexingWarning'
}

packagingOptions {
exclude 'META-INF/*'
}
}

dependencies {
implementation files('libs/pngquant-android-release.aar')

implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'

//https://github.com/zetbaitsu/Compressor
//implementation 'id.zelory:compressor:3.0.0'

//https://github.com/AppIntro/AppIntro
implementation 'com.github.AppIntro:AppIntro:5.1.0'

//https://github.com/falnatsheh/MarkdownView
implementation 'us.feras.mdv:markdownview:1.1.0'
}

This file was deleted.

94 changes: 47 additions & 47 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.wrmndfzzy.atomize">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_atom"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".AboutActivity"
android:label="@string/aboutactivity_label"
android:parentActivityName=".MainActivity"
android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTTIVITY"
android:value="com.wrmndfzzy.atomize.MainActivity" />
</activity>
<activity
android:name=".LicenseActivity"
android:label="@string/licenseactivity_label"
android:parentActivityName=".AboutActivity"
android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTTIVITY"
android:value="com.wrmndfzzy.atomize.AboutActivity" />
</activity>
<activity
android:name=".intro.IntroActivity"
android:screenOrientation="portrait"
android:theme="@style/IntroTheme" />
</application>
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.wrmndfzzy.atomize">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_atom"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".AboutActivity"
android:label="@string/aboutactivity_label"
android:parentActivityName=".MainActivity"
android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.wrmndfzzy.atomize.MainActivity" />
</activity>
<activity
android:name=".LicenseActivity"
android:label="@string/licenseactivity_label"
android:parentActivityName=".AboutActivity"
android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.wrmndfzzy.atomize.AboutActivity" />
</activity>
<activity
android:name=".intro.IntroActivity"
android:screenOrientation="portrait"
android:theme="@style/IntroTheme" />
</application>

</manifest>
3 changes: 2 additions & 1 deletion app/src/main/assets/atomizeLicense.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
h3, ul {
color: #ffffff;
}

</style>
</head>
<body>
Expand Down Expand Up @@ -320,4 +321,4 @@ <h3>
</font></pre>

</body>
</html>
</html>
3 changes: 2 additions & 1 deletion app/src/main/assets/licenses.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
h3, ul {
color: #ffffff;
}

</style>
</head>
<body>
Expand Down Expand Up @@ -434,4 +435,4 @@ <h3>
</font></pre>

</body>
</html>
</html>
67 changes: 26 additions & 41 deletions app/src/main/java/com/wrmndfzzy/atomize/AboutActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

import android.app.Dialog;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;

import androidx.appcompat.app.AppCompatActivity;

import com.wrmndfzzy.atomize.intro.IntroActivity;

import us.feras.mdv.MarkdownView;

public class AboutActivity extends AppCompatActivity {
Expand All @@ -22,7 +24,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);

list = (ListView) findViewById(R.id.about_list);
list = findViewById(R.id.about_list);

ArrayAdapter adapter = new ArrayAdapter<>(this,
R.layout.about_list_item, aboutArray);
Expand All @@ -32,61 +34,44 @@ protected void onCreate(Bundle savedInstanceState) {
addClickListener();
}

private void addClickListener(){
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> av, View v, int pos,
long id) {
if(pos == 0){
Intent i = new Intent(AboutActivity.this, com.wrmndfzzy.atomize.LicenseActivity.class);
startActivity(i);
}
else if(pos == 1){
aboutAppDialog();
}
else if(pos == 2){
aboutWrmndfzzyDialog();
private void addClickListener() {
list.setOnItemClickListener((av, v, pos, id) -> {
if (pos == 0) {
Intent i = new Intent(AboutActivity.this, LicenseActivity.class);
startActivity(i);
} else if (pos == 1) {
aboutAppDialog();
} else if (pos == 2) {
aboutWrmndfzzyDialog();

}
else{
Intent i = new Intent(AboutActivity.this, com.wrmndfzzy.atomize.intro.IntroActivity.class);
startActivity(i);
}
} else {
Intent i = new Intent(AboutActivity.this, IntroActivity.class);
startActivity(i);
}
});
}

protected void aboutAppDialog(){
protected void aboutAppDialog() {
final Dialog aaDialog = new Dialog(AboutActivity.this);
aaDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
aaDialog.setTitle("About App");
aaDialog.setContentView(R.layout.aboutapp_dialog);
MarkdownView markdownView = (MarkdownView) aaDialog.findViewById(R.id.atomizeReadme);
Button aaDialogConfirm = (Button) aaDialog.findViewById(R.id.aaDialogConfirm);
MarkdownView markdownView = aaDialog.findViewById(R.id.atomizeReadme);
Button aaDialogConfirm = aaDialog.findViewById(R.id.aaDialogConfirm);
markdownView.loadMarkdownFile("file:///android_asset/readme.md", "file:///android_asset/readme.css");
aaDialogConfirm.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
aaDialog.dismiss();
}
});
aaDialogConfirm.setOnClickListener(v -> aaDialog.dismiss());
aaDialog.show();
}

protected void aboutWrmndfzzyDialog(){
protected void aboutWrmndfzzyDialog() {
final Dialog awDialog = new Dialog(AboutActivity.this);
awDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
awDialog.setTitle("About Wrmndfzzy");
awDialog.setContentView(R.layout.aboutwrmndfzzy_dialog);
MarkdownView markdownView = (MarkdownView) awDialog.findViewById(R.id.wrmndfzzyReadme);
Button aaDialogConfirm = (Button) awDialog.findViewById(R.id.awDialogConfirm);
MarkdownView markdownView = awDialog.findViewById(R.id.wrmndfzzyReadme);
Button aaDialogConfirm = awDialog.findViewById(R.id.awDialogConfirm);
markdownView.loadMarkdownFile("file:///android_asset/wrmndfzzy.md", "file:///android_asset/wrmndfzzy.css");
aaDialogConfirm.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
awDialog.dismiss();
}
});
aaDialogConfirm.setOnClickListener(v -> awDialog.dismiss());
awDialog.show();
}
}
Loading