-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f12a5e2
Showing
33 changed files
with
900 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
.cxx | ||
local.properties |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
BSD 2-Clause License | ||
|
||
Copyright (c) 2022, -Smooth-E- | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
plugins { | ||
id 'com.android.application' | ||
} | ||
|
||
android { | ||
compileSdk 31 | ||
|
||
defaultConfig { | ||
applicationId "com.smoothie.monetcolors" | ||
minSdk 31 | ||
targetSdk 31 | ||
versionCode 1 | ||
versionName "1.0" | ||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
} | ||
|
||
dependencies { | ||
|
||
implementation 'androidx.appcompat:appcompat:1.4.1' | ||
implementation 'com.google.android.material:material:1.5.0' | ||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3' | ||
testImplementation 'junit:junit:4.13.2' | ||
androidTestImplementation 'androidx.test.ext:junit:1.1.3' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' | ||
|
||
implementation 'com.github.christophesmet:android_maskable_layout:v1.3.1' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.smoothie.monetcolors"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/Theme.MonetColorPreviewer"> | ||
<activity | ||
android:name=".MainActivity" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
123 changes: 123 additions & 0 deletions
123
app/src/main/java/com/smoothie/monetcolors/MainActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
package com.smoothie.monetcolors; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
import android.content.Context; | ||
import android.content.res.ColorStateList; | ||
import android.graphics.Color; | ||
import android.os.Bundle; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.FrameLayout; | ||
import android.widget.LinearLayout; | ||
import android.widget.TextView; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
|
||
public static class Entry { | ||
int color; | ||
String name; | ||
|
||
public Entry (int id, String name) { | ||
this.color = id; | ||
this.name = name; | ||
} | ||
} | ||
|
||
Entry[] colors = new Entry[] { | ||
new Entry(R.color.accent1_0, "@android:color/system_accent1_0" ), | ||
new Entry(R.color.accent1_10, "@android:color/system_accent1_10" ), | ||
new Entry(R.color.accent1_50, "@android:color/system_accent1_50" ), | ||
new Entry(R.color.accent1_100, "@android:color/system_accent1_100" ), | ||
new Entry(R.color.accent1_200, "@android:color/system_accent1_200" ), | ||
new Entry(R.color.accent1_300, "@android:color/system_accent1_300" ), | ||
new Entry(R.color.accent1_400, "@android:color/system_accent1_400" ), | ||
new Entry(R.color.accent1_500, "@android:color/system_accent1_500" ), | ||
new Entry(R.color.accent1_600, "@android:color/system_accent1_600" ), | ||
new Entry(R.color.accent1_700, "@android:color/system_accent1_700" ), | ||
new Entry(R.color.accent1_800, "@android:color/system_accent1_800" ), | ||
new Entry(R.color.accent1_900, "@android:color/system_accent1_900" ), | ||
new Entry(R.color.accent1_1000, "@android:color/system_accent1_1000"), | ||
|
||
new Entry(R.color.accent2_0, "@android:color/system_accent2_0" ), | ||
new Entry(R.color.accent2_10, "@android:color/system_accent2_10" ), | ||
new Entry(R.color.accent2_50, "@android:color/system_accent2_50" ), | ||
new Entry(R.color.accent2_100, "@android:color/system_accent2_100" ), | ||
new Entry(R.color.accent2_200, "@android:color/system_accent2_200" ), | ||
new Entry(R.color.accent2_300, "@android:color/system_accent2_300" ), | ||
new Entry(R.color.accent2_400, "@android:color/system_accent2_400" ), | ||
new Entry(R.color.accent2_500, "@android:color/system_accent2_500" ), | ||
new Entry(R.color.accent2_600, "@android:color/system_accent2_600" ), | ||
new Entry(R.color.accent2_700, "@android:color/system_accent2_700" ), | ||
new Entry(R.color.accent2_800, "@android:color/system_accent2_800" ), | ||
new Entry(R.color.accent2_900, "@android:color/system_accent2_900" ), | ||
new Entry(R.color.accent2_1000, "@android:color/system_accent2_1000"), | ||
|
||
new Entry(R.color.neutral1_0, "@android:color/system_neutral1_0" ), | ||
new Entry(R.color.neutral1_10, "@android:color/system_neutral1_10" ), | ||
new Entry(R.color.neutral1_50, "@android:color/system_neutral1_50" ), | ||
new Entry(R.color.neutral1_100, "@android:color/system_neutral1_100" ), | ||
new Entry(R.color.neutral1_200, "@android:color/system_neutral1_200" ), | ||
new Entry(R.color.neutral1_300, "@android:color/system_neutral1_300" ), | ||
new Entry(R.color.neutral1_400, "@android:color/system_neutral1_400" ), | ||
new Entry(R.color.neutral1_500, "@android:color/system_neutral1_500" ), | ||
new Entry(R.color.neutral1_600, "@android:color/system_neutral1_600" ), | ||
new Entry(R.color.neutral1_700, "@android:color/system_neutral1_700" ), | ||
new Entry(R.color.neutral1_800, "@android:color/system_neutral1_800" ), | ||
new Entry(R.color.neutral1_900, "@android:color/system_neutral1_900" ), | ||
new Entry(R.color.neutral1_1000, "@android:color/system_neutral1_1000"), | ||
|
||
new Entry(R.color.neutral2_0, "@android:color/system_neutral2_0" ), | ||
new Entry(R.color.neutral2_10, "@android:color/system_neutral2_10" ), | ||
new Entry(R.color.neutral2_50, "@android:color/system_neutral2_50" ), | ||
new Entry(R.color.neutral2_100, "@android:color/system_neutral2_100" ), | ||
new Entry(R.color.neutral2_200, "@android:color/system_neutral2_200" ), | ||
new Entry(R.color.neutral2_300, "@android:color/system_neutral2_300" ), | ||
new Entry(R.color.neutral2_400, "@android:color/system_neutral2_400" ), | ||
new Entry(R.color.neutral2_500, "@android:color/system_neutral2_500" ), | ||
new Entry(R.color.neutral2_600, "@android:color/system_neutral2_600" ), | ||
new Entry(R.color.neutral2_700, "@android:color/system_neutral2_700" ), | ||
new Entry(R.color.neutral2_800, "@android:color/system_neutral2_800" ), | ||
new Entry(R.color.neutral2_900, "@android:color/system_neutral2_900" ), | ||
new Entry(R.color.neutral2_1000, "@android:color/system_neutral2_1000"), | ||
}; | ||
|
||
LinearLayout colorParent; | ||
FrameLayout background; | ||
FrameLayout colorDroplet; | ||
TextView colorName; | ||
|
||
private void colorOnClick (Entry entry) { | ||
background.setBackgroundTintList(ColorStateList.valueOf(getColor(entry.color))); | ||
colorDroplet.setBackgroundTintList(ColorStateList.valueOf(getColor(entry.color))); | ||
colorName.setText(entry.name); | ||
} | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
|
||
colorParent = findViewById(R.id.colors_list); | ||
background = findViewById(R.id.background); | ||
colorDroplet = findViewById(R.id.color_droplet); | ||
colorName = findViewById(R.id.color_name_text_view); | ||
|
||
LayoutInflater inflater = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); | ||
for (Entry entry : colors) { | ||
View view = inflater.inflate(R.layout.view_color_entry, null); | ||
view.findViewById(R.id.background).setBackgroundTintList(ColorStateList.valueOf(getColor(entry.color))); | ||
view.findViewById(R.id.background).setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
colorOnClick(entry); | ||
} | ||
}); | ||
colorParent.addView(view); | ||
} | ||
colorOnClick(colors[4]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<solid android:color="@color/accent1_50"/> | ||
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="108dp" | ||
android:height="108dp" | ||
android:viewportWidth="108" | ||
android:viewportHeight="108" | ||
android:tint="@color/accent1_200"> | ||
<group android:scaleX="2.25" | ||
android:scaleY="2.25" | ||
android:translateX="27" | ||
android:translateY="27"> | ||
<path android:fillAlpha="0.3" | ||
android:fillColor="@android:color/white" | ||
android:pathData="M12,4c-4.41,0 -8,3.59 -8,8s3.59,8 8,8c0.28,0 0.5,-0.22 0.5,-0.5 0,-0.16 -0.08,-0.28 -0.14,-0.35 -0.41,-0.46 -0.63,-1.05 -0.63,-1.65 0,-1.38 1.12,-2.5 2.5,-2.5L16,15c2.21,0 4,-1.79 4,-4 0,-3.86 -3.59,-7 -8,-7zM6.5,13c-0.83,0 -1.5,-0.67 -1.5,-1.5S5.67,10 6.5,10s1.5,0.67 1.5,1.5S7.33,13 6.5,13zM9.5,9C8.67,9 8,8.33 8,7.5S8.67,6 9.5,6s1.5,0.67 1.5,1.5S10.33,9 9.5,9zM14.5,9c-0.83,0 -1.5,-0.67 -1.5,-1.5S13.67,6 14.5,6s1.5,0.67 1.5,1.5S15.33,9 14.5,9zM19,11.5c0,0.83 -0.67,1.5 -1.5,1.5s-1.5,-0.67 -1.5,-1.5 0.67,-1.5 1.5,-1.5 1.5,0.67 1.5,1.5z" android:strokeAlpha="0.3"/> | ||
<path android:fillColor="@android:color/white" android:pathData="M12,2C6.49,2 2,6.49 2,12s4.49,10 10,10c1.38,0 2.5,-1.12 2.5,-2.5 0,-0.61 -0.23,-1.21 -0.64,-1.67 -0.08,-0.09 -0.13,-0.21 -0.13,-0.33 0,-0.28 0.22,-0.5 0.5,-0.5L16,17c3.31,0 6,-2.69 6,-6 0,-4.96 -4.49,-9 -10,-9zM16,15h-1.77c-1.38,0 -2.5,1.12 -2.5,2.5 0,0.61 0.22,1.19 0.63,1.65 0.06,0.07 0.14,0.19 0.14,0.35 0,0.28 -0.22,0.5 -0.5,0.5 -4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.14 8,7c0,2.21 -1.79,4 -4,4z"/> | ||
<path android:fillColor="@android:color/white" android:pathData="M6.5,11.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/> | ||
<path android:fillColor="@android:color/white" android:pathData="M9.5,7.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/> | ||
<path android:fillColor="@android:color/white" android:pathData="M14.5,7.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/> | ||
<path android:fillColor="@android:color/white" android:pathData="M17.5,11.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/> | ||
</group> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<vector android:height="24dp" android:tint="@color/accent1_200" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillAlpha="0.3" | ||
android:fillColor="@android:color/white" | ||
android:pathData="M12,4c-4.41,0 -8,3.59 -8,8s3.59,8 8,8c0.28,0 0.5,-0.22 0.5,-0.5 0,-0.16 -0.08,-0.28 -0.14,-0.35 -0.41,-0.46 -0.63,-1.05 -0.63,-1.65 0,-1.38 1.12,-2.5 2.5,-2.5L16,15c2.21,0 4,-1.79 4,-4 0,-3.86 -3.59,-7 -8,-7zM6.5,13c-0.83,0 -1.5,-0.67 -1.5,-1.5S5.67,10 6.5,10s1.5,0.67 1.5,1.5S7.33,13 6.5,13zM9.5,9C8.67,9 8,8.33 8,7.5S8.67,6 9.5,6s1.5,0.67 1.5,1.5S10.33,9 9.5,9zM14.5,9c-0.83,0 -1.5,-0.67 -1.5,-1.5S13.67,6 14.5,6s1.5,0.67 1.5,1.5S15.33,9 14.5,9zM19,11.5c0,0.83 -0.67,1.5 -1.5,1.5s-1.5,-0.67 -1.5,-1.5 0.67,-1.5 1.5,-1.5 1.5,0.67 1.5,1.5z" android:strokeAlpha="0.3"/> | ||
<path android:fillColor="@android:color/white" android:pathData="M12,2C6.49,2 2,6.49 2,12s4.49,10 10,10c1.38,0 2.5,-1.12 2.5,-2.5 0,-0.61 -0.23,-1.21 -0.64,-1.67 -0.08,-0.09 -0.13,-0.21 -0.13,-0.33 0,-0.28 0.22,-0.5 0.5,-0.5L16,17c3.31,0 6,-2.69 6,-6 0,-4.96 -4.49,-9 -10,-9zM16,15h-1.77c-1.38,0 -2.5,1.12 -2.5,2.5 0,0.61 0.22,1.19 0.63,1.65 0.06,0.07 0.14,0.19 0.14,0.35 0,0.28 -0.22,0.5 -0.5,0.5 -4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.14 8,7c0,2.21 -1.79,4 -4,4z"/> | ||
<path android:fillColor="@android:color/white" android:pathData="M6.5,11.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/> | ||
<path android:fillColor="@android:color/white" android:pathData="M9.5,7.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/> | ||
<path android:fillColor="@android:color/white" android:pathData="M14.5,7.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/> | ||
<path android:fillColor="@android:color/white" android:pathData="M17.5,11.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<solid android:color="@color/accent1_50"/> | ||
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<solid android:color="#FFFF"/> | ||
<corners android:radius="50dp"/> | ||
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<solid android:color="#FFFF" /> | ||
<corners android:topRightRadius="50dp" android:topLeftRadius="50dp" /> | ||
</shape> |
Oops, something went wrong.