diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e9398d90ec24ed17e2f50889557bf8035903cebb..0e2f2c9fae9be2eed45124b569a8e5c2142ccb43 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,6 +34,7 @@ unitTests: build: stage: build script: + - ./gradlew assembleRelease - ./gradlew assembleDebug artifacts: paths: diff --git a/LICENSE b/LICENSE.md similarity index 100% rename from LICENSE rename to LICENSE.md diff --git a/README.md b/README.md index 3441e54100a68eab27d836e3616be7b2f1e6d298..c11fcd728e7d06d173f2b1adf6b8ad5bc2bc4a68 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@  -Icon pack compatible with Trebuchet, Kiss Launcher, Lawnchair Launcher, OpenLauncher, Adw and many more launchers. A Material Design inspired theme aiming to provide a consistent and minimalistic look to your device. Code forked from [Icecons icon pack](https://github.com/1C3/ICEcons). Only [F-Droid](https://f-droid.org/) hosted apps are supported. - +Icon pack compatible with Trebuchet, Kiss Launcher, Lawnchair Launcher, OpenLauncher, Adw, and many more launchers. A Material Design inspired theme aiming to provide a consistent and minimalistic look to your device. Code forked from [Icecons icon pack](https://github.com/1C3/ICEcons). Only [F-Droid](https://f-droid.org/) hosted apps are supported. # Contributions are welcome @@ -47,10 +46,14 @@ For requesting icons or contributing, please use the [Issue Tracker](https://git --> # Installation - -[](https://f-droid.org/app/org.xphnx.ameixa) -[](https://gitlab.com/xphnx/ameixa/-/jobs/85391706/artifacts/browse/app/build/outputs/apk/) - +<a href="https://f-droid.org/app/org.xphnx.ameixa"> + <img src="https://f-droid.org/badge/get-it-on.png" + alt="Get it on F-Droid" height="80"> +</a> +<a href="https://gitlab.com/xphnx/ameixa/-/jobs/86232495/artifacts/file/app/build/outputs/apk/debug/app-debug.apk"> + <img src="https://gitlab.com/xphnx/ameixa/uploads/6d80e2e22d2fcbfd8ed320e58f4705e1/apk.png" + alt="Download debug apk" height="80"> +</a> # License diff --git a/app/build.gradle b/app/build.gradle index e195775051365ea8ddde3c0eba146d8b028048cd..2c203db30bb3533ae237d5ac5afd22fe0d006aef 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -25,9 +25,15 @@ android { buildTypes { release { - minifyEnabled false + minifyEnabled true + shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } + debug { + zipAlignEnabled true + applicationIdSuffix ".debug" + versionNameSuffix "-debug" + } } } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 848d0237b15c64745ba0122da89be52fc376eda6..3fa6060978b52d020aaed2deca867a3d3d0926d1 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,24 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- - * This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see <http://www.gnu.org/licenses/>. -* -* @author xphnx based on Icecons (https://github.com/1C3/ICEcons) -* ---> - <manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="org.xphnx.ameixa"> + package="org.xphnx.ameixa" android:installLocation="auto"> <application android:allowBackup="true" diff --git a/app/src/main/java/org/xphnx/ameixa/IceImageUtils.java b/app/src/main/java/org/xphnx/ameixa/IceImageUtils.java index 8b108c7b32f2fd9cf0b778a9efdddf7f8201ea86..0fee1bd719c4b7d3f78870fa2ebd54246ca18d86 100644 --- a/app/src/main/java/org/xphnx/ameixa/IceImageUtils.java +++ b/app/src/main/java/org/xphnx/ameixa/IceImageUtils.java @@ -11,60 +11,60 @@ import java.lang.ref.WeakReference; public class IceImageUtils { - public static void bitmapLoadAsync( ImageView imageView, Resources res, int resId, int width, int height ) { + public static void bitmapLoadAsync(ImageView imageView, Resources res, int resId, int width, int height) { - BitmapWorkerTask task = new BitmapWorkerTask( imageView ); + BitmapWorkerTask task = new BitmapWorkerTask(imageView); task.res = res; task.resId = resId; task.width = width; task.height = height; - task.execute( resId ); + task.execute(resId); } - public static Bitmap bitmapLoad( Resources res, int resId, int width, int height ) { + public static Bitmap bitmapLoad(Resources res, int resId, int width, int height) { // calc scale, load appropriately sampled bitmap from given resource BitmapFactory.Options resOptions = new BitmapFactory.Options(); resOptions.inJustDecodeBounds = true; - BitmapFactory.decodeResource( res, resId, resOptions ); + BitmapFactory.decodeResource(res, resId, resOptions); int resHeight = resOptions.outHeight; int resWidth = resOptions.outWidth; float xScale = (float) width / (float) resWidth; float yScale = (float) height / (float) resHeight; - float scale = Math.max( xScale, yScale ); - if( scale > 1 ) + float scale = Math.max(xScale, yScale); + if(scale > 1) - if( width == 0 ) width = Math.round( resWidth / scale ); - else if( height == 0 ) height = Math.round( resHeight / scale ); + if(width == 0) width = Math.round(resWidth / scale); + else if(height == 0) height = Math.round(resHeight / scale); - resOptions.inSampleSize = sampleSize( scale ); + resOptions.inSampleSize = sampleSize(scale); resWidth /= resOptions.inSampleSize; resHeight /= resOptions.inSampleSize; resOptions.inJustDecodeBounds = false; - Bitmap rawBitmap = BitmapFactory.decodeResource( res, resId, resOptions ); + Bitmap rawBitmap = BitmapFactory.decodeResource(res, resId, resOptions); // compare aspect ratio and crop - rawBitmap = bitmapCrop( rawBitmap, width, height, resWidth, resHeight ); + rawBitmap = bitmapCrop(rawBitmap, width, height, resWidth, resHeight); // scale to desired size - return Bitmap.createScaledBitmap( rawBitmap, width, height, true ); + return Bitmap.createScaledBitmap(rawBitmap, width, height, true); } // calc sample size for scaled resource loading - private static int sampleSize( float scale ) { + private static int sampleSize(float scale) { int size = 1; - while( scale < 0.5f ) { + while(scale < 0.5f) { size *= 2; scale *= 2; @@ -75,39 +75,39 @@ public class IceImageUtils { // crop bitmap to chosen aspect ratio - private static Bitmap bitmapCrop( Bitmap rawBitmap, int width, int height, int resWidth, int resHeight ) { + private static Bitmap bitmapCrop(Bitmap rawBitmap, int width, int height, int resWidth, int resHeight) { int cropX, cropY, cropWidth, cropHeight; float xScale = (float) width / (float) resWidth; float yScale = (float) height / (float) resHeight; - float scale = Math.max( xScale, yScale ); + float scale = Math.max(xScale, yScale); - if( xScale >= yScale ) { - cropWidth = Math.round( resWidth ); + if(xScale >= yScale) { + cropWidth = Math.round(resWidth); cropX = 0; - cropHeight = Math.round( height / scale ); - cropY = ( resHeight - cropHeight ) / 2; + cropHeight = Math.round(height / scale); + cropY = (resHeight - cropHeight) / 2; } else { - cropWidth = Math.round( width / scale ); - cropX = ( resWidth - cropWidth ) / 2; - cropHeight = Math.round( resHeight ); + cropWidth = Math.round(width / scale); + cropX = (resWidth - cropWidth) / 2; + cropHeight = Math.round(resHeight); cropY = 0; } - return Bitmap.createBitmap( rawBitmap, cropX, cropY, cropWidth, cropHeight ); + return Bitmap.createBitmap(rawBitmap, cropX, cropY, cropWidth, cropHeight); } } -class BitmapWorkerTask extends AsyncTask< Integer, Void, Bitmap > { +class BitmapWorkerTask extends AsyncTask<Integer, Void, Bitmap> { - private final WeakReference< ImageView > imageViewReference; + private final WeakReference<ImageView> imageViewReference; Resources res; int resId, width, height; - public BitmapWorkerTask( ImageView imageView ) { + public BitmapWorkerTask(ImageView imageView) { imageViewReference = new WeakReference<ImageView>(imageView); } @@ -115,31 +115,31 @@ class BitmapWorkerTask extends AsyncTask< Integer, Void, Bitmap > { // Decode image in background @Override - protected Bitmap doInBackground( Integer... parameters ) { + protected Bitmap doInBackground(Integer... parameters) { - return IceImageUtils.bitmapLoad( res, resId, width, height ); + return IceImageUtils.bitmapLoad(res, resId, width, height); } // Check if image view still exists and set bitmap @Override - protected void onPostExecute( Bitmap bitmap ) { + protected void onPostExecute(Bitmap bitmap) { - if ( imageViewReference != null && bitmap != null ) { + if (imageViewReference != null && bitmap != null) { final ImageView imageView = imageViewReference.get(); - if ( imageView != null ) { + if (imageView != null) { imageView.setImageBitmap(bitmap); - imageView.setAlpha( 0f ); - imageView.setVisibility( View.VISIBLE ); + imageView.setAlpha(0f); + imageView.setVisibility(View.VISIBLE); imageView.animate() .alpha(1f) - .setDuration( res.getInteger( android.R.integer.config_mediumAnimTime ) ) - .setListener( null ); + .setDuration(res.getInteger(android.R.integer.config_mediumAnimTime)) + .setListener(null); } } } diff --git a/app/src/main/java/org/xphnx/ameixa/IceScreenUtils.java b/app/src/main/java/org/xphnx/ameixa/IceScreenUtils.java index 39be0b1e790c77515d76e1b8e32abf232c9c80e2..d2b42ae1cb37d3f0c5463b7b67e95a867aadffd9 100644 --- a/app/src/main/java/org/xphnx/ameixa/IceScreenUtils.java +++ b/app/src/main/java/org/xphnx/ameixa/IceScreenUtils.java @@ -6,6 +6,6 @@ class IceScreenUtils { static float densityScale(Context context) { - return ( context.getResources().getDisplayMetrics().density ); + return (context.getResources().getDisplayMetrics().density); } } \ No newline at end of file diff --git a/app/src/main/java/org/xphnx/ameixa/LicenseActivity.java b/app/src/main/java/org/xphnx/ameixa/LicenseActivity.java index bc085ff7caaf2097f4a0514a9737a0478d4a71e0..f892b8c5e62a89f0aeb0f04ae973d3c88e541cbe 100644 --- a/app/src/main/java/org/xphnx/ameixa/LicenseActivity.java +++ b/app/src/main/java/org/xphnx/ameixa/LicenseActivity.java @@ -13,9 +13,9 @@ import android.widget.TextView; public class LicenseActivity extends AppCompatActivity { @Override - protected void onCreate( Bundle savedInstanceState ) { + protected void onCreate(Bundle savedInstanceState) { - super.onCreate( savedInstanceState ); + super.onCreate(savedInstanceState); createLayout(); } @@ -23,90 +23,79 @@ public class LicenseActivity extends AppCompatActivity { // main centered layout - LinearLayout.LayoutParams smallLayoutParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1f ); - float scale = IceScreenUtils.densityScale( getApplicationContext() ); - int padding = Math.round( 64 * scale ); + LinearLayout.LayoutParams smallLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1f); + float scale = IceScreenUtils.densityScale(getApplicationContext()); + int padding = Math.round(64 * scale); - LinearLayout frameLayout = new LinearLayout( this ); - frameLayout.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT ) ); - frameLayout.setBackgroundColor( 0xffffffff ); - frameLayout.setGravity( Gravity.CENTER ); - setContentView( frameLayout ); + LinearLayout frameLayout = new LinearLayout(this); + frameLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT)); + frameLayout.setBackgroundColor(0xffffffff); + frameLayout.setGravity(Gravity.CENTER); + setContentView(frameLayout); - LinearLayout baseLayout = new LinearLayout( this ); - baseLayout.setOrientation( LinearLayout.VERTICAL ); - baseLayout.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT ) ); - baseLayout.setGravity( Gravity.START ); - frameLayout.addView( baseLayout ); + LinearLayout baseLayout = new LinearLayout(this); + baseLayout.setOrientation(LinearLayout.VERTICAL); + baseLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT)); + baseLayout.setGravity(Gravity.START); + frameLayout.addView(baseLayout); // gpl button - LinearLayout sourceLayout = new LinearLayout( this ); - sourceLayout.setOrientation( LinearLayout.HORIZONTAL ); - sourceLayout.setLayoutParams( smallLayoutParams ); - sourceLayout.setGravity( Gravity.CENTER ); - baseLayout.addView( sourceLayout ); - - LinearLayout sourceClickLayout = new LinearLayout( this ); - sourceClickLayout.setOrientation( LinearLayout.HORIZONTAL ); - sourceClickLayout.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT ) ); - sourceClickLayout.setGravity( Gravity.CENTER ); - sourceLayout.addView( sourceClickLayout ); - sourceClickLayout.setOnClickListener( new View.OnClickListener() { - @Override - public void onClick( View v ) { - gplLink( v ); - } - }); - - TextView sourceText = new TextView( this ); - sourceText.setText( R.string.codelicense); - sourceText.setTextSize( 16 ); - sourceText.setTextColor( ContextCompat.getColor( getApplicationContext(), R.color.colorPrimaryDark) ); - sourceText.setPadding( padding, padding, padding, padding ); - sourceClickLayout.addView( sourceText ); + LinearLayout sourceLayout = new LinearLayout(this); + sourceLayout.setOrientation(LinearLayout.HORIZONTAL); + sourceLayout.setLayoutParams(smallLayoutParams); + sourceLayout.setGravity(Gravity.CENTER); + baseLayout.addView(sourceLayout); + + LinearLayout sourceClickLayout = new LinearLayout(this); + sourceClickLayout.setOrientation(LinearLayout.HORIZONTAL); + sourceClickLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT)); + sourceClickLayout.setGravity(Gravity.CENTER); + sourceLayout.addView(sourceClickLayout); + sourceClickLayout.setOnClickListener((View v) -> gplLink(v)); + + TextView sourceText = new TextView(this); + sourceText.setText(R.string.codelicense); + sourceText.setTextSize(16); + sourceText.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.colorPrimaryDark)); + sourceText.setPadding(padding, padding, padding, padding); + sourceClickLayout.addView(sourceText); // cc button - LinearLayout imgLayout = new LinearLayout( this ); - imgLayout.setOrientation( LinearLayout.HORIZONTAL ); - imgLayout.setLayoutParams( smallLayoutParams ); - imgLayout.setGravity( Gravity.CENTER ); - imgLayout.setBackgroundColor( 0xff000000 ); - baseLayout.addView( imgLayout ); - - LinearLayout imgClickLayout = new LinearLayout( this ); - imgClickLayout.setOrientation( LinearLayout.HORIZONTAL ); - imgClickLayout.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT ) ); - imgClickLayout.setGravity( Gravity.CENTER ); - imgLayout.addView( imgClickLayout ); - imgClickLayout.setOnClickListener( new View.OnClickListener() { - @Override - public void onClick( View v ) { - ccLink( v ); - } - }); - - TextView aboutText = new TextView( this ); - aboutText.setText( R.string.imageslicense ); - aboutText.setTextSize( 16 ); - aboutText.setTextColor( 0xffffffff ); - aboutText.setPadding( padding, padding, padding, padding ); - imgClickLayout.addView( aboutText ); - + LinearLayout imgLayout = new LinearLayout(this); + imgLayout.setOrientation(LinearLayout.HORIZONTAL); + imgLayout.setLayoutParams(smallLayoutParams); + imgLayout.setGravity(Gravity.CENTER); + imgLayout.setBackgroundColor(0xff000000); + baseLayout.addView(imgLayout); + + LinearLayout imgClickLayout = new LinearLayout(this); + imgClickLayout.setOrientation(LinearLayout.HORIZONTAL); + imgClickLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT)); + imgClickLayout.setGravity(Gravity.CENTER); + imgLayout.addView(imgClickLayout); + imgClickLayout.setOnClickListener((View v) -> ccLink(v)); + + TextView aboutText = new TextView(this); + aboutText.setText(R.string.imageslicense); + aboutText.setTextSize(16); + aboutText.setTextColor(0xffffffff); + aboutText.setPadding(padding, padding, padding, padding); + imgClickLayout.addView(aboutText); } - public void gplLink( View v ) { + public void gplLink(View v) { - Uri uri = Uri.parse( getString(R.string.urlgplv3) ); - Intent intent = new Intent( Intent.ACTION_VIEW, uri ); - startActivity( intent ); + Uri uri = Uri.parse(getString(R.string.urlgplv3)); + Intent intent = new Intent(Intent.ACTION_VIEW, uri); + startActivity(intent); } - public void ccLink( View v ) { + public void ccLink(View v) { - Uri uri = Uri.parse( getString(R.string.urlccbysa4) ); - Intent intent = new Intent( Intent.ACTION_VIEW, uri ); - startActivity( intent ); + Uri uri = Uri.parse(getString(R.string.urlccbysa4)); + Intent intent = new Intent(Intent.ACTION_VIEW, uri); + startActivity(intent); } } \ No newline at end of file diff --git a/app/src/main/java/org/xphnx/ameixa/MainActivity.java b/app/src/main/java/org/xphnx/ameixa/MainActivity.java index 75753fd439b5b8cdbd5d5f1bc33b0edb523211c2..e856f0a678ffff7634dd119f04eb7813a0e6a94e 100644 --- a/app/src/main/java/org/xphnx/ameixa/MainActivity.java +++ b/app/src/main/java/org/xphnx/ameixa/MainActivity.java @@ -16,9 +16,9 @@ import android.widget.TextView; public class MainActivity extends AppCompatActivity { @Override - protected void onCreate( Bundle savedInstanceState ) { + protected void onCreate(Bundle savedInstanceState) { - super.onCreate( savedInstanceState ); + super.onCreate(savedInstanceState); createLayout(); } @@ -26,103 +26,88 @@ public class MainActivity extends AppCompatActivity { // main centered layout - LinearLayout.LayoutParams smallLayoutParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1f ); - float scale = IceScreenUtils.densityScale( getApplicationContext() ); - ViewGroup.LayoutParams buttonParams = new ViewGroup.LayoutParams( Math.round( 48 * scale ), Math.round( 48 * scale ) ); + LinearLayout.LayoutParams smallLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1f); + float scale = IceScreenUtils.densityScale(getApplicationContext()); + ViewGroup.LayoutParams buttonParams = new ViewGroup.LayoutParams(Math.round(48 * scale), Math.round(48 * scale)); - LinearLayout frameLayout = new LinearLayout( this ); - frameLayout.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT ) ); - frameLayout.setBackgroundColor( 0xffffffff ); - frameLayout.setGravity( Gravity.CENTER ); - setContentView( frameLayout ); + LinearLayout frameLayout = new LinearLayout(this); + frameLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT)); + frameLayout.setBackgroundColor(0xffffffff); + frameLayout.setGravity(Gravity.CENTER); + setContentView(frameLayout); - LinearLayout baseLayout = new LinearLayout( this ); - baseLayout.setOrientation( LinearLayout.VERTICAL ); - baseLayout.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT ) ); - baseLayout.setGravity( Gravity.START ); - frameLayout.addView( baseLayout ); - - + LinearLayout baseLayout = new LinearLayout(this); + baseLayout.setOrientation(LinearLayout.VERTICAL); + baseLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT)); + baseLayout.setGravity(Gravity.START); + frameLayout.addView(baseLayout); // source code button - LinearLayout sourceLayout = new LinearLayout( this ); - sourceLayout.setOrientation( LinearLayout.HORIZONTAL ); - sourceLayout.setLayoutParams( smallLayoutParams ); - sourceLayout.setGravity( Gravity.CENTER_VERTICAL ); - baseLayout.addView( sourceLayout ); - - LinearLayout sourceClickLayout = new LinearLayout( this ); - sourceClickLayout.setOrientation( LinearLayout.HORIZONTAL ); - sourceClickLayout.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT ) ); - sourceClickLayout.setGravity( Gravity.CENTER ); - sourceLayout.addView( sourceClickLayout ); - sourceClickLayout.setOnClickListener( new View.OnClickListener() { - @Override - public void onClick( View v ) { - gitLink( v ); - } - }); - - Button sourceButton = new Button( this ); - sourceButton.setLayoutParams( buttonParams ); - sourceButton.setBackground( new BitmapDrawable( getResources(), IceImageUtils.bitmapLoad( getApplicationContext().getResources(), R.drawable.ic_source_button, Math.round( 48 * scale ), Math.round( 48 * scale ) ) ) ); + LinearLayout sourceLayout = new LinearLayout(this); + sourceLayout.setOrientation(LinearLayout.HORIZONTAL); + sourceLayout.setLayoutParams(smallLayoutParams); + sourceLayout.setGravity(Gravity.CENTER_VERTICAL); + baseLayout.addView(sourceLayout); + + LinearLayout sourceClickLayout = new LinearLayout(this); + sourceClickLayout.setOrientation(LinearLayout.HORIZONTAL); + sourceClickLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT)); + sourceClickLayout.setGravity(Gravity.CENTER); + sourceLayout.addView(sourceClickLayout); + sourceClickLayout.setOnClickListener((View v) -> gitLink(v)); + + Button sourceButton = new Button(this); + sourceButton.setLayoutParams(buttonParams); + sourceButton.setBackground(new BitmapDrawable(getResources(), IceImageUtils.bitmapLoad(getApplicationContext().getResources(), R.drawable.ic_source_button, Math.round(48 * scale), Math.round(48 * scale)))); sourceButton.setClickable(false); - sourceClickLayout.addView( sourceButton ); + sourceClickLayout.addView(sourceButton); - TextView sourceText = new TextView( this ); - sourceText.setText( R.string.sourcecodetext ); - sourceText.setTextSize( 24 ); - sourceText.setTextColor( ContextCompat.getColor( getApplicationContext(), R.color.colorPrimaryDark) ); + TextView sourceText = new TextView(this); + sourceText.setText(R.string.sourcecodetext); + sourceText.setTextSize(24); + sourceText.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.colorPrimaryDark)); sourceText.setPadding(64, 64, 64, 64); - sourceClickLayout.addView( sourceText ); + sourceClickLayout.addView(sourceText); // license button - LinearLayout aboutLayout = new LinearLayout( this ); - aboutLayout.setOrientation( LinearLayout.HORIZONTAL ); - aboutLayout.setLayoutParams( smallLayoutParams ); - aboutLayout.setGravity( Gravity.CENTER_VERTICAL ); - baseLayout.addView( aboutLayout ); - - LinearLayout aboutClickLayout = new LinearLayout( this ); - aboutClickLayout.setOrientation( LinearLayout.HORIZONTAL ); - aboutClickLayout.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT ) ); - aboutClickLayout.setGravity( Gravity.CENTER ); - aboutLayout.addView( aboutClickLayout ); - aboutClickLayout.setOnClickListener( new View.OnClickListener() { - @Override - public void onClick( View v ) { - licenseShow( v ); - } - }); - - Button aboutButton = new Button( this ); - aboutButton.setLayoutParams( buttonParams ); - aboutButton.setBackground( new BitmapDrawable( getResources(), IceImageUtils.bitmapLoad( getApplicationContext().getResources(), R.drawable.ic_license_button, Math.round( 48 * scale ), Math.round( 48 * scale ) ) ) ); + LinearLayout aboutLayout = new LinearLayout(this); + aboutLayout.setOrientation(LinearLayout.HORIZONTAL); + aboutLayout.setLayoutParams(smallLayoutParams); + aboutLayout.setGravity(Gravity.CENTER_VERTICAL); + baseLayout.addView(aboutLayout); + + LinearLayout aboutClickLayout = new LinearLayout(this); + aboutClickLayout.setOrientation(LinearLayout.HORIZONTAL); + aboutClickLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT)); + aboutClickLayout.setGravity(Gravity.CENTER); + aboutLayout.addView(aboutClickLayout); + aboutClickLayout.setOnClickListener((View v) -> licenseShow(v)); + + Button aboutButton = new Button(this); + aboutButton.setLayoutParams(buttonParams); + aboutButton.setBackground(new BitmapDrawable(getResources(), IceImageUtils.bitmapLoad(getApplicationContext().getResources(), R.drawable.ic_license_button, Math.round(48 * scale), Math.round(48 * scale)))); aboutButton.setClickable(false); - aboutClickLayout.addView( aboutButton ); + aboutClickLayout.addView(aboutButton); - TextView aboutText = new TextView( this ); - aboutText.setText( R.string.licensetext ); - aboutText.setTextSize( 24 ); - aboutText.setTextColor( ContextCompat.getColor( getApplicationContext(), R.color.colorPrimaryDark) ); + TextView aboutText = new TextView(this); + aboutText.setText(R.string.licensetext); + aboutText.setTextSize(24); + aboutText.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.colorPrimaryDark)); aboutText.setPadding(64, 64, 64, 64); - aboutClickLayout.addView( aboutText ); - + aboutClickLayout.addView(aboutText); } - public void gitLink( View v ) { + public void gitLink(View v) { - Uri uri = Uri.parse( getString(R.string.sourcecodelink) ); - Intent intent = new Intent( Intent.ACTION_VIEW, uri ); - startActivity( intent ); + Uri uri = Uri.parse(getString(R.string.sourcecodelink)); + Intent intent = new Intent(Intent.ACTION_VIEW, uri); + startActivity(intent); } - - public void licenseShow( View v ) { - - Intent intent = new Intent( this, LicenseActivity.class ); - startActivity( intent ); + public void licenseShow(View v) { + Intent intent = new Intent(this, LicenseActivity.class); + startActivity(intent); } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8fbab465372130c1d5c3f55ffc3d692a8db5f984..e4a50b5dd5ccebef1b268719dd6aa75668103a4c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,12 +1,11 @@ <resources> <string name="app_name">Ameixa</string> - <string name="sourcecodetext">source code</string> - <string name="licensetext">license</string> + <string name="sourcecodetext">Source code</string> + <string name="licensetext">License</string> <string name="sourcecodelink">https://gitlab.com/xphnx/ameixa</string> - <string name="codelicense">This program\'s source code is avaiable under the GNU General Public License v3.</string> - <string name="imageslicense">The images included in this program are avaiable under the Creative Commons Attribution Share Alike 4.0 license, except for non-compatible derivates licenses (See credits).</string> - <string name="urlgplv3">http://choosealicense.com/licenses/gpl-3.0/</string> - <string name="urlccbysa4">https://creativecommons.org/licenses/by-sa/4.0/</string> + <string name="codelicense">This program\'s source code is available under the GNU General Public License v3.</string> + <string name="imageslicense">The images included in this program are available under the Creative Commons Attribution Share Alike 4.0 license, except for non-compatible derivative licenses (see credits).</string> + <string name="urlgplv3">https://choosealicense.com/licenses/gpl-3.0</string> + <string name="urlccbysa4">https://creativecommons.org/licenses/by-sa/4.0</string> <bool name="config_iconpack">true</bool> -</resources> - +</resources> \ No newline at end of file diff --git a/app/src/main/res/xml/appfilter.xml b/app/src/main/res/xml/appfilter.xml index 738731a25b0f6633baa6715f682fb67d408bdb68..63a659dd0f6ab2c1d41d5a23507ddf8c8ad8dac8 100644 --- a/app/src/main/res/xml/appfilter.xml +++ b/app/src/main/res/xml/appfilter.xml @@ -1,19 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- - * This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* You should have received a copy of the GNU General Public License -* along with this program. If not, see <http://www.gnu.org/licenses/>. -* @author xphnx -*/ ---> <resources> @@ -1441,8 +1426,6 @@ <item component="ComponentInfo{com.cityzen.cityzen/com.cityzen.cityzen.Activities.SplashScreenActivity}" drawable="cityzen"/> <item component="ComponentInfo{io.github.hidroh.materialistic/io.github.hidroh.materialistic.LauncherActivity}" drawable="hn" /> - - <!-- Nova Launcher specific --> <item component=":BROWSER" drawable="browser" /> <item component=":CALCULATOR" drawable="calculator" /> diff --git a/fastlane/metadata/android/en-US/full_description.txt b/fastlane/metadata/android/en-US/full_description.txt index d61a8a74a5d9d5a80ab03ba2d026507cf5ae3c22..e5321e2e7ffbce3a74a478fcc04a30e5aa6d9bfb 100644 --- a/fastlane/metadata/android/en-US/full_description.txt +++ b/fastlane/metadata/android/en-US/full_description.txt @@ -1,2 +1,2 @@ -Icon pack compatible with Kiss Launcher, OpenLauncher, ADW and many other launchers. The icons follow Material Design guidelines in order to provide a minimalist and consistent look to your device. +Icon pack compatible with Kiss Launcher, OpenLauncher, Lawnchair Launcher, ADW and many other launchers. The icons follow Material Design guidelines in order to provide a minimalist and consistent look to your device. Only FLOSS apps are supported. For adding new icons see <a href="https://gitlab.com/xphnx/ameixa/blob/master/README.md">Readme</a>. diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000000000000000000000000000000000000..271685344a0cb32c189a04bbb297f0234dab4e36 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Xmx128m -Dfile.encoding=UTF-8 + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega \ No newline at end of file diff --git a/process_wipsvg.sh b/process_wipsvg.sh index 41d10da16b4e1abb16d3a4d2cb319550af647a0a..d8a937034903502d456de6d1060db041aecfab84 100755 --- a/process_wipsvg.sh +++ b/process_wipsvg.sh @@ -24,16 +24,16 @@ done # "xml" crea los correspondientes values/iconpack.xml y xml/drawable.xml SVGDIR="icons" #esto puede obviarse? que hace code.xml? -ICPACK_PRE=' <item>' +ICPACK_PRE='<item>' ICPACK_SUF='</item>\n' -DRAWABLE_PRE=' <item drawable="' +DRAWABLE_PRE='<item drawable="' DRAWABLE_SUF='" />\n' -CODE_PRE=' R.drawable.nodpi_' +CODE_PRE='R.drawable.nodpi_' CODE_SUF=',\n' -printf '<?xml version="1.0" encoding="utf-8"?>\n<resources>\n <string-array name="icon_pack" translatable="false">\n' > app/src/main/res/values/iconpack.xml -printf '<?xml version="1.0" encoding="utf-8"?>\n<resources>\n <version>1</version>\n' > app/src/main/res/xml/drawable.xml -#printf ' private Integer[] mImages = {\n' > code.xml +printf '<?xml version="1.0" encoding="utf-8"?>\n<resources>\n <string-array name="icon_pack" translatable="false">\n' > app/src/main/res/values/iconpack.xml +printf '<?xml version="1.0" encoding="utf-8"?>\n<resources>\n <version>1</version>\n' > app/src/main/res/xml/drawable.xml +#printf 'private Integer[] mImages = {\n'> code.xml for DIR in $(find ${SVGDIR} -name "*.svg") do @@ -41,9 +41,9 @@ do NAME=${FILE%.*} printf "${ICPACK_PRE}${NAME}${ICPACK_SUF}" >> app/src/main/res/values/iconpack.xml printf "${DRAWABLE_PRE}${NAME}${DRAWABLE_SUF}" >> app/src/main/res/xml/drawable.xml - # printf "${CODE_PRE}${NAME}${CODE_SUF}" >> code.xml + #printf "${CODE_PRE}${NAME}${CODE_SUF}" >> code.xml done -printf ' </string-array>\n</resources>\n' >> app/src/main/res/values/iconpack.xml +printf '</string-array>\n</resources>\n' >> app/src/main/res/values/iconpack.xml printf '</resources>\n' >> app/src/main/res/xml/drawable.xml -#printf ' };' >> code.xml \ No newline at end of file +#printf '};' >> code.xml \ No newline at end of file diff --git a/todo/wip/1Note.md b/todo/wip/1Note.md index 1369434e0d342cb4a9ddf1dcab5aa3062df3261f..a4d30a9da8b2301ab7441b0e81fe199810147e18 100644 --- a/todo/wip/1Note.md +++ b/todo/wip/1Note.md @@ -1,3 +1,2 @@ 1. Place the svgs to be included in the next update here. -2. (Optional) Run the script (process_wipsvg.sh). It generates proper pngs from each svg and move from "todo/wip" to "icons". And writes the iconpack.xml and drawable.xml. - +2. (Optional) Run the script (process_wipsvg.sh). It generates proper pngs from each svg, moves them from "todo/wip" to "icons", and writes to iconpack.xml and drawable.xml. \ No newline at end of file