Skip to content

Commit 8c5e554

Browse files
Merge pull request #1 from dilipsuthar97/new_features
New features v3.2.2
2 parents 4f25765 + 56d2091 commit 8c5e554

82 files changed

Lines changed: 2478 additions & 595 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.

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright [yyyy] [name of copyright owner]
189+
Copyright 2019 Dilip Suthar
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,26 @@ The app Material Color Palette allows developers and programmers to get their re
2525
</p>
2626

2727
## :muscle: Support Development
28-
<a href="https://www.buymeacoffee.com/dilipsuthar97">
29-
<img src="https://raw.githubusercontent.com/ravjanisz/imagecrypt/master/docs/assets/bmc.png" alt="Buy me a coffee ☕">
30-
</a>
28+
29+
There are few ways you can do it:
30+
31+
- Starring and sharing the projects you like 🚀
32+
- Please follow [dilipsuthar97](https://github.com/dilipsuthar97) on GitHub.
33+
34+
<a href="https://www.buymeacoffee.com/dilipsuthar97" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee ☕" style="height: auto !important;width: auto !important;" ></a>
35+
36+
Thanks! ❤️
37+
<br/>
38+
[dilipsuthar97.github.io](https://dilipsuthar97.github.io)
39+
<br/>
3140

3241
## :iphone: Social
3342
[![Twitter](https://img.shields.io/twitter/follow/dilipsuthar97?label=Follow&style=social)](https://twitter.com/dilipsuthar97)
3443
![GitHub](https://img.shields.io/github/followers/dilipsuthar97?label=Follow&style=social)
3544

3645
## :scroll: License
3746
```
38-
Copyright 2020 Dilip Suthar
47+
Copyright 2019 Dilip Suthar
3948
4049
Licensed under the Apache License, Version 2.0 (the "License");
4150
you may not use this file except in compliance with the License.
@@ -53,4 +62,4 @@ limitations under the License.
5362
## :copyright: Legal
5463
If you're going to use this code, please disclose the source (me)! Thank You!
5564

56-
Copyright © 2020 Dilip Suthar (dilipsuthar97)
65+
Copyright © 2019 Dilip Suthar (dilipsuthar97)

app/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
/build
2-
/release
2+
/release
3+
/google-services.json
4+
/sampledata

app/build.gradle

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,45 @@ apply plugin: 'kotlin-android'
44
apply plugin: 'kotlin-android-extensions'
55
apply plugin: 'kotlin-kapt'
66

7-
apply plugin: 'io.fabric'
7+
apply plugin: 'com.google.firebase.crashlytics'
8+
apply plugin: 'com.google.firebase.firebase-perf'
89

910
android {
1011
compileSdkVersion 29
11-
buildToolsVersion "29.0.2"
12+
buildToolsVersion "29.0.3"
1213
defaultConfig {
1314
applicationId "com.techflow.materialcolor"
1415
minSdkVersion 22
1516
targetSdkVersion 29
16-
versionCode 220030201
17-
versionName "3.2.1"
17+
versionCode 220030202
18+
versionName "3.2.2"
1819
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1920
}
21+
signingConfigs {
22+
release {
23+
if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
24+
storeFile file(MYAPP_UPLOAD_STORE_FILE)
25+
storePassword MYAPP_UPLOAD_STORE_PASSWORD
26+
keyAlias MYAPP_UPLOAD_KEY_ALIAS
27+
keyPassword MYAPP_UPLOAD_KEY_PASSWORD
28+
}
29+
}
30+
}
2031
buildTypes {
2132
release {
2233
minifyEnabled true
23-
//shrinkResources true
34+
shrinkResources true
35+
//resConfigs "en"
2436
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
37+
signingConfig signingConfigs.release
38+
}
39+
debug {
40+
FirebasePerformance {
41+
// Set this flag to 'false' to disable @AddTrace annotation processing and
42+
// automatic HTTP/S network request monitoring
43+
// for a specific build variant at compile time.
44+
instrumentationEnabled false
45+
}
2546
}
2647
}
2748
buildTypes.each {
@@ -46,11 +67,14 @@ dependencies {
4667
implementation 'com.android.billingclient:billing:2.1.0' // In app purchase
4768
implementation 'com.android.billingclient:billing-ktx:2.1.0'
4869
implementation 'androidx.browser:browser:1.0.0' // Chrome custom tab
49-
implementation 'com.google.android.play:core:1.6.4' // Play store core
70+
implementation 'com.google.android.play:core:1.7.3' // Play store core
71+
implementation 'com.google.android.play:core-ktx:1.7.0'
5072

5173
// Firebase
52-
implementation 'com.google.firebase:firebase-analytics:17.4.2' // Analytics
53-
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1' // Crashlytics
74+
implementation 'com.google.firebase:firebase-analytics-ktx:17.4.3' // Analytics
75+
implementation 'com.google.firebase:firebase-crashlytics:17.0.1' // Crashlytics
76+
implementation 'com.google.firebase:firebase-perf:19.0.7' // Performance
77+
implementation 'com.google.firebase:firebase-config-ktx:19.1.4' // Remote Config
5478

5579
testImplementation 'junit:junit:4.12'
5680
androidTestImplementation 'androidx.test:runner:1.2.0'
@@ -66,8 +90,9 @@ dependencies {
6690
implementation 'com.afollestad.material-dialogs:color:3.1.1'
6791
implementation 'com.mikhaellopez:circularimageview:3.2.0' // Circle Image View
6892
implementation 'com.android.support:support-annotations:28.0.0' // Required Dependency by Audience Network SDK
69-
implementation 'com.facebook.android:audience-network-sdk:5.+' // Facebook audience
93+
implementation 'com.facebook.android:audience-network-sdk:5.+' // Facebook audience
7094
implementation 'com.github.sephiroth74:android-target-tooltip:2.0.4' // Tooltip
95+
implementation 'com.romandanylyk:pageindicatorview:1.0.3' // Page indicator (view pager)
7196

7297
def room_version = "1.1.1" // Room database
7398
implementation "android.arch.persistence.room:runtime:$room_version"

app/src/main/AndroidManifest.xml

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,40 @@
1616
android:roundIcon="@mipmap/ic_launcher"
1717
android:supportsRtl="true"
1818
android:theme="@style/MaterialColor.Base.Light">
19-
<activity android:name=".activity.FlatUIColorsActivity"/>
20-
<activity android:name=".activity.SupportDevelopmentActivity" />
21-
<activity android:name=".activity.DesignToolActivity" />
22-
<activity android:name=".activity.CustomGradientActivity" />
23-
<activity android:name=".activity.SettingsActivity" />
24-
<activity android:name=".activity.ColorActivity" />
25-
<activity android:name=".activity.CustomColorActivity" />
26-
<activity android:name=".activity.HomeActivity" />
19+
<activity android:name=".activity.LicensesActivity"></activity>
20+
<activity
21+
android:name=".activity.AppIntroActivity"
22+
android:screenOrientation="portrait" />
23+
<activity
24+
android:name=".activity.MetroColorsActivity"
25+
android:screenOrientation="portrait" />
26+
<activity
27+
android:name=".activity.SocialColorsActivity"
28+
android:screenOrientation="portrait" />
29+
<activity
30+
android:name=".activity.FlatUIColorsActivity"
31+
android:screenOrientation="portrait" />
32+
<activity
33+
android:name=".activity.SupportDevelopmentActivity"
34+
android:screenOrientation="portrait" />
35+
<activity
36+
android:name=".activity.DesignToolActivity"
37+
android:screenOrientation="portrait" />
38+
<activity
39+
android:name=".activity.CustomGradientActivity"
40+
android:screenOrientation="portrait" />
41+
<activity
42+
android:name=".activity.SettingsActivity"
43+
android:screenOrientation="portrait" />
44+
<activity
45+
android:name=".activity.ColorActivity"
46+
android:screenOrientation="portrait" />
47+
<activity
48+
android:name=".activity.CustomColorActivity"
49+
android:screenOrientation="portrait" />
50+
<activity
51+
android:name=".activity.HomeActivity"
52+
android:screenOrientation="portrait" />
2753
<activity android:name=".activity.WelcomeActivity">
2854
<intent-filter>
2955
<action android:name="android.intent.action.MAIN" />
@@ -33,6 +59,7 @@
3359
</activity>
3460
<activity
3561
android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
62+
android:screenOrientation="portrait"
3663
android:theme="@style/Base.Theme.AppCompat" />
3764

3865
<meta-data

app/src/main/java/com/techflow/materialcolor/MaterialColor.kt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import android.content.Context
55
import android.content.pm.ApplicationInfo
66
import android.util.Log
77
import com.techflow.materialcolor.helpers.displayToast
8+
import com.techflow.materialcolor.helpers.isDebug
89
import com.techflow.materialcolor.helpers.isTablet
910
import com.techflow.materialcolor.utils.ThemeUtils
1011

@@ -28,12 +29,18 @@ class MaterialColor : Application() {
2829
const val FIREBASE_EVENT_TAB_BOOKMARKED_COLOR = "tab_bookmarked_color_"
2930
const val FIREBASE_EVENT_REMOVE_ADS = "remove_ads_"
3031
const val FIREBASE_EVENT_CUSTOM_COLOR_MAKER = "custom_color_maker_"
31-
const val FIREBASE_EVENT_CUSTOM_GRADIENT_MAKER = "custom_gradient_maker"
32+
const val FIREBASE_EVENT_CUSTOM_GRADIENT_MAKER = "custom_gradient_maker_"
3233
const val FIREBASE_EVENT_ABOUT_ME = "about_me_"
3334
const val FIREBASE_EVENT_READ_POLICY = "read_policy_"
3435
const val FIREBASE_EVENT_MATERIAL_DESIGN_TOOL = "material_design_tool_"
36+
const val FIREBASE_EVENT_FLAT_UI_COLORS = "flat_ui_colors_"
37+
const val FIREBASE_EVENT_SOCIAL_COLORS = "social_colors_"
38+
const val FIREBASE_EVENT_METRO_COLORS = "metro_colors_"
3539
const val FIREBASE_EVENT_SUPPORT_DEVELOPMENT = "support_development_"
3640
const val FIREBASE_EVENT_DARK_MODE = "dark_mode_"
41+
const val FIREBASE_EVENT_COPY_HEX_CODE = "copy_hex_code_"
42+
const val FIREBASE_EVENT_COPY_RGB_CODE = "copy_rgb_code_"
43+
const val FIREBASE_EVENT_COPY_HSV_CODE = "copy_hsv_code_"
3744

3845
fun getInstance(): MaterialColor {
3946
return instance
@@ -45,31 +52,24 @@ class MaterialColor : Application() {
4552
AdType.INTERSTITIAL -> BuildConfig.AUDIENCE_INTERSTITIAL_ID
4653
}
4754
}
48-
49-
fun isDebug(ctx: Context): Boolean {
50-
try {
51-
return (ctx.applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE) !== 0
52-
} catch (ignored: Exception) {
53-
}
54-
return false
55-
}
5655
}
5756

5857
override fun onCreate() {
59-
when(ThemeUtils.getTheme(this)) {
58+
when (ThemeUtils.getTheme(this)) {
6059
ThemeUtils.LIGHT -> setTheme(R.style.MaterialColor_Base_Light)
6160
ThemeUtils.DARK -> setTheme(R.style.MaterialColor_Base_Dark)
6261
}
6362
super.onCreate()
6463
instance = this
6564

66-
if (isDebug(this)) displayToast("You'r in debug mode")
67-
6865
// TODO: remove during production
69-
if (this.isTablet())
70-
Log.d(TAG, "Tablet")
71-
else
72-
Log.d(TAG, "Phone")
66+
if (isDebug()) {
67+
displayToast("You'r in debug mode")
68+
if (this.isTablet())
69+
Log.d(TAG, "Tablet")
70+
else
71+
Log.d(TAG, "Phone")
72+
}
7373
}
7474

7575
}
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
package com.techflow.materialcolor.activity
2+
3+
import android.app.Activity
4+
import android.content.Context
5+
import android.content.Intent
6+
import android.os.Bundle
7+
import android.view.LayoutInflater
8+
import android.view.View
9+
import android.view.ViewGroup
10+
import android.widget.TextView
11+
import androidx.core.content.ContextCompat
12+
import androidx.databinding.DataBindingUtil
13+
import androidx.viewpager.widget.PagerAdapter
14+
import androidx.viewpager.widget.ViewPager
15+
import com.google.android.material.button.MaterialButton
16+
import com.techflow.materialcolor.R
17+
import com.techflow.materialcolor.databinding.ActivityAppIntroBinding
18+
import com.techflow.materialcolor.utils.ThemeUtils
19+
20+
/**
21+
* Created by Dilip Suthar on 10/06/2020
22+
*/
23+
class AppIntroActivity : BaseActivity(), ViewPager.OnPageChangeListener {
24+
25+
// Static
26+
companion object {
27+
private lateinit var wizard_titles: Array<String>
28+
private lateinit var wizard_descs: Array<String>
29+
}
30+
31+
private lateinit var bind: ActivityAppIntroBinding
32+
private lateinit var viewPagerAdapter: ViewPagerAdapter
33+
34+
override fun onCreate(savedInstanceState: Bundle?) {
35+
super.onCreate(savedInstanceState)
36+
bind = DataBindingUtil.setContentView(this, R.layout.activity_app_intro)
37+
38+
initComponents()
39+
}
40+
41+
private fun initComponents() {
42+
wizard_titles = resources.getStringArray(R.array.wizard_titles)
43+
wizard_descs = resources.getStringArray(R.array.wizard_descriptions)
44+
45+
/*bottomProgressDots(0)*/
46+
bind.pageIndicator.count = wizard_titles.size
47+
bind.pageIndicator.selection = 0
48+
if (ThemeUtils.getTheme(this) == ThemeUtils.LIGHT) {
49+
bind.pageIndicator.unselectedColor = ContextCompat.getColor(this, R.color.overlay_dark_30)
50+
} else {
51+
bind.pageIndicator.unselectedColor = ContextCompat.getColor(this, R.color.overlay_light_30)
52+
}
53+
54+
viewPagerAdapter = ViewPagerAdapter(this, bind.viewPager)
55+
bind.viewPager.adapter = viewPagerAdapter
56+
bind.viewPager.setOnPageChangeListener(this)
57+
}
58+
59+
/*private fun bottomProgressDots(currentIndex: Int) {
60+
val dots = arrayOfNulls<ImageView>(MAX_STEP)
61+
62+
bind.layoutDots.removeAllViews()
63+
for ((i, value) in dots.withIndex()) {
64+
dots[i] = ImageView(this)
65+
val width_height = 15
66+
val params = LinearLayout.LayoutParams(ViewGroup.LayoutParams(width_height, width_height))
67+
params.setMargins(10, 10, 10, 10)
68+
dots[i]?.layoutParams = params
69+
dots[i]?.setImageResource(R.drawable.shape_round)
70+
dots[i]?.setColorFilter(ContextCompat.getColor(this, R.color.grey_200), PorterDuff.Mode.SRC_IN)
71+
bind.layoutDots.addView(dots[i])
72+
}
73+
74+
if (dots.isNotEmpty()) {
75+
dots[currentIndex]?.setImageResource(R.drawable.shape_round)
76+
dots[currentIndex]?.setColorFilter(ThemeUtils.getThemeAttrColor(this, R.attr.colorPrimary), PorterDuff.Mode.SRC_IN)
77+
}
78+
}*/
79+
80+
override fun onPageSelected(position: Int) {
81+
/*bottomProgressDots(position)*/
82+
bind.pageIndicator.selection = position
83+
}
84+
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
85+
86+
}
87+
override fun onPageScrollStateChanged(state: Int) {
88+
89+
}
90+
91+
/**
92+
* View pager adapter
93+
*/
94+
class ViewPagerAdapter(val activity: Activity, private val viewPager: ViewPager) : PagerAdapter() {
95+
override fun instantiateItem(container: ViewGroup, position: Int): Any {
96+
val layoutInflater = activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
97+
98+
val view = layoutInflater.inflate(R.layout.item_app_intro_wizard, container, false)
99+
view.findViewById<TextView>(R.id.title).text = wizard_titles[position]
100+
view.findViewById<TextView>(R.id.description).text = wizard_descs[position]
101+
102+
val btnNext = view.findViewById<MaterialButton>(R.id.btn_next)
103+
if (position == wizard_titles.size - 1) {
104+
btnNext.text = "Get started"
105+
} else {
106+
btnNext.text = "Next"
107+
}
108+
109+
btnNext.setOnClickListener {
110+
val current = viewPager.currentItem + 1
111+
if (current < wizard_titles.size) {
112+
viewPager.currentItem = current
113+
} else {
114+
activity.startActivity(Intent(activity, HomeActivity::class.java))
115+
activity.finish()
116+
}
117+
}
118+
119+
container.addView(view)
120+
return view
121+
}
122+
123+
override fun getCount(): Int {
124+
return wizard_titles.size
125+
}
126+
127+
override fun isViewFromObject(view: View, `object`: Any): Boolean {
128+
return view == `object`
129+
}
130+
131+
override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
132+
val view = `object` as View
133+
container.removeView(view)
134+
}
135+
}
136+
}

0 commit comments

Comments
 (0)