Skip to content

Commit 0bb2690

Browse files
Merge pull request #3 from ShwetaChauhan18/master
Update :
2 parents 95a4f6a + c1e7c8c commit 0bb2690

File tree

19 files changed

+301
-81
lines changed

19 files changed

+301
-81
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The actual features are:
2020
### Demo
2121
------------------------
2222

23-
![demo_data](https://github.com/simformsolutions/CustomEditTextOutLineBorder/blob/master/images/data.gif)
23+
![demo_data](https://github.com/simformsolutions/CustomEditTextOutLineBorder/blob/master/images/data_new.gif)
2424

2525
### Gradle Dependency
2626
* Add the JitPack repository to your project's build.gradle file
@@ -38,7 +38,7 @@ allprojects {
3838

3939
```
4040
dependencies {
41-
implementation 'com.github.simformsolutions:SSCustomEditTextOutLineBorder:1.0.7'
41+
implementation 'com.github.simformsolutions:SSCustomEditTextOutLineBorder:1.0.8'
4242
}
4343
```
4444

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ dependencies {
4444
+Libs.Kotlin.stdLib
4545
+Libs.Androidx.appCompat
4646
+Libs.Kotlin.ktxCore
47+
+Libs.Kotlin.coroutinesAndroid
48+
+Libs.Kotlin.viewModelKtx
4749
+Libs.sdp
4850
+Libs.ssp
4951
+Libs.timber
@@ -52,6 +54,4 @@ dependencies {
5254
}
5355

5456
implementation(project(":customedittextoutlinedborder"))
55-
androidTestImplementation(TestLibraries.extJunit)
56-
androidTestImplementation(TestLibraries.espresso)
5757
}

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
android:roundIcon="@mipmap/ic_launcher_round"
1010
android:supportsRtl="true"
1111
android:theme="@style/AppTheme">
12-
<activity android:name="com.simform.customedittextoutlineborder.MainActivity">
12+
<activity android:name="com.simform.customedittextoutlineborder.SplashActivity">
1313
<intent-filter>
1414
<action android:name="android.intent.action.MAIN" />
1515

1616
<category android:name="android.intent.category.LAUNCHER" />
1717
</intent-filter>
1818
</activity>
19+
<activity android:name="com.simform.customedittextoutlineborder.MainActivity" />
1920
</application>
2021

2122
</manifest>

app/src/main/java/com/simform/customedittextoutlineborder/BaseActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import com.simform.customcomponent.BR
2626
/**
2727
* This is base activity of all activities
2828
*/
29-
abstract class BaseActivity<Binding : ViewDataBinding, ViewModel : MainActivityViewModel> : AppCompatActivity(), View.OnClickListener {
29+
abstract class BaseActivity<Binding : ViewDataBinding, ViewModel : androidx.lifecycle.ViewModel> : AppCompatActivity(), View.OnClickListener {
3030

3131
protected lateinit var bindObject: Binding
3232
protected abstract val mViewModel: ViewModel
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package com.simform.customedittextoutlineborder
2+
3+
import android.content.Intent
4+
import android.graphics.Color
5+
import android.os.Bundle
6+
import android.view.View
7+
import androidx.lifecycle.Observer
8+
import androidx.lifecycle.ViewModelProviders
9+
import shweta.com.customedittextoutlineborder.R
10+
import shweta.com.customedittextoutlineborder.databinding.SplashActivityBinding
11+
import timber.log.Timber
12+
13+
class SplashActivity : BaseActivity<SplashActivityBinding, SplashActivityViewModel>() {
14+
15+
override val mViewModel: SplashActivityViewModel
16+
get() = ViewModelProviders.of(this).get(SplashActivityViewModel::class.java)
17+
18+
override fun getLayoutResId(): Int = R.layout.activity_splash
19+
20+
override fun init() {
21+
22+
}
23+
24+
override fun onPostCreate(savedInstanceState: Bundle?) {
25+
super.onPostCreate(savedInstanceState)
26+
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
27+
window.statusBarColor = Color.TRANSPARENT
28+
}
29+
30+
override fun initializeObservers() {
31+
mViewModel.mutableLiveData.observe(this, Observer {
32+
when (it) {
33+
is SplashActivityViewModel.SplashState.MainActivity -> {
34+
startActivity(Intent(this, MainActivity::class.java))
35+
finish()
36+
}
37+
}
38+
})
39+
}
40+
41+
42+
override fun onClick(v: View?) {
43+
Timber.e("init")
44+
}
45+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/**
2+
* Copyright 2019 PoolTrader
3+
* Develop By Shweta Chauhan
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.simform.customedittextoutlineborder
17+
18+
import androidx.lifecycle.MutableLiveData
19+
import androidx.lifecycle.ViewModel
20+
import androidx.lifecycle.viewModelScope
21+
import kotlinx.coroutines.delay
22+
import kotlinx.coroutines.launch
23+
24+
/**
25+
* Splash ActivityViewModel
26+
*/
27+
class SplashActivityViewModel : ViewModel() {
28+
val mutableLiveData = MutableLiveData<SplashState>()
29+
private val splashScreenDelay: Long = 3000
30+
31+
init {
32+
viewModelScope.launch {
33+
delay(splashScreenDelay)
34+
mutableLiveData.postValue(SplashState.MainActivity)
35+
}
36+
}
37+
38+
/**
39+
* This class is used to show splash state.
40+
*/
41+
sealed class SplashState {
42+
/**
43+
* This object is used to navigate splash screen to main activity.
44+
*/
45+
object MainActivity : SplashState()
46+
}
47+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android">
3+
<solid android:color="@color/color_white" />
4+
<corners
5+
android:topLeftRadius="@dimen/_25sdp"
6+
android:topRightRadius="@dimen/_25sdp" />
7+
<padding android:top="@dimen/_10sdp" />
8+
</shape>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<shape xmlns:android="http://schemas.android.com/apk/res/android">
3-
<solid android:color="@color/colorAccent" />
3+
<solid android:color="@color/colorPrimary" />
44
<corners android:radius="@dimen/_22sdp" />
55
</shape>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="496dp"
3+
android:height="496dp"
4+
android:viewportWidth="496"
5+
android:viewportHeight="496">
6+
<path
7+
android:pathData="M247.992,5.163C111.048,5.163 0,116.627 0,254.163c0,109.992 71.048,203.32 169.632,236.24c12.392,2.296 16.912,-5.392 16.912,-12c0,-5.904 -0.216,-21.56 -0.336,-42.344c-69,15.064 -83.552,-33.376 -83.552,-33.376c-11.264,-28.768 -27.52,-36.408 -27.52,-36.408c-22.528,-15.456 1.696,-15.16 1.696,-15.16c24.88,1.752 37.976,25.672 37.976,25.672c22.144,38.048 58.064,27.048 72.192,20.672c2.232,-16.08 8.656,-27.064 15.736,-33.28c-55.056,-6.296 -112.944,-27.64 -112.944,-123.04c0,-27.176 9.656,-49.408 25.52,-66.832c-2.568,-6.296 -11.072,-31.6 2.416,-65.872c0,0 20.832,-6.688 68.2,25.52c19.784,-5.52 41,-8.28 62.096,-8.392c21.048,0.112 42.28,2.864 62.096,8.392c47.328,-32.208 68.128,-25.52 68.128,-25.52c13.52,34.272 5.016,59.576 2.456,65.872c15.904,17.424 25.504,39.648 25.504,66.832c0,95.64 -57.984,116.68 -113.232,122.856c8.904,7.688 16.832,22.872 16.832,46.112c0,33.296 -0.296,60.128 -0.296,68.296c0,6.672 4.472,14.424 17.048,11.968C425.016,457.387 496,364.123 496,254.163C496,116.627 384.952,5.163 247.992,5.163z"
8+
android:fillColor="#ffffff"/>
9+
<path
10+
android:pathData="M247.992,5.163C111.048,5.163 0,116.627 0,254.163c0,109.992 71.048,203.32 169.632,236.24c12.392,2.296 16.912,-5.392 16.912,-12c0,-5.904 -0.216,-21.56 -0.336,-42.344c-69,15.064 -83.552,-33.376 -83.552,-33.376c-11.264,-28.768 -27.52,-36.408 -27.52,-36.408c-22.528,-15.456 1.696,-15.16 1.696,-15.16c24.88,1.752 37.976,25.672 37.976,25.672c22.144,38.048 58.064,27.048 72.192,20.672c2.232,-16.08 8.656,-27.064 15.736,-33.28c-55.056,-6.296 -112.944,-27.64 -112.944,-123.04c0,-27.176 9.656,-49.408 25.52,-66.832c-2.568,-6.296 -11.072,-31.6 2.416,-65.872c0,0 20.832,-6.688 68.2,25.52c19.784,-5.52 41,-8.28 62.096,-8.392c21.048,0.112 42.28,2.864 62.096,8.392c47.328,-32.208 68.128,-25.52 68.128,-25.52c13.52,34.272 5.016,59.576 2.456,65.872c15.904,17.424 25.504,39.648 25.504,66.832c0,95.64 -57.984,116.68 -113.232,122.856c8.904,7.688 16.832,22.872 16.832,46.112c0,33.296 -0.296,60.128 -0.296,68.296c0,6.672 4.472,14.424 17.048,11.968C425.016,457.387 496,364.123 496,254.163C496,116.627 384.952,5.163 247.992,5.163z"
11+
android:fillColor="#ffffff"/>
12+
<path
13+
android:pathData="M378.496,109.131c13.128,33.904 4.752,58.928 2.2,65.176c15.904,17.424 25.504,39.648 25.504,66.832c0,95.64 -57.984,116.68 -113.232,122.856c8.904,7.688 16.832,22.872 16.832,46.112c0,33.296 -0.296,60.128 -0.296,68.296c0,6.672 4.472,14.424 17.048,11.968C425.016,457.387 496,364.123 496,254.163c0,-29.56 -5.152,-57.896 -14.568,-84.2C447.24,133.963 409.184,109.987 378.496,109.131z"
14+
android:fillColor="#ffffff"/>
15+
<path
16+
android:pathData="M192.976,377.323c2.784,-5.616 6.184,-9.984 9.76,-13.144c-30.176,-3.456 -61.168,-11.512 -83.048,-33.744C136.52,358.451 163.928,371.195 192.976,377.323z"
17+
android:fillColor="#ffffff"/>
18+
<path
19+
android:pathData="M12.912,270.947c0,-137.536 111.048,-249 247.992,-249c76.04,0 144.056,34.392 189.536,88.488C405.52,46.755 331.616,5.163 247.992,5.163C111.048,5.163 0,116.627 0,254.163c0,61.32 22.12,117.424 58.752,160.792C29.944,374.291 12.912,324.643 12.912,270.947z"
20+
android:fillColor="#ffffff"/>
21+
<path
22+
android:pathData="M322.712,426.899c0,-23.232 -7.928,-38.44 -16.832,-46.128c55.248,-6.16 113.24,-27.216 113.24,-122.848c0,-27.184 -9.6,-49.4 -25.52,-66.824c2.576,-6.296 11.096,-31.608 -2.456,-65.872c0,0 -2.576,-0.792 -7.896,-0.488c5.808,25.84 -0.416,44.32 -2.552,49.568c15.904,17.424 25.504,39.648 25.504,66.832c0,95.64 -57.984,116.68 -113.232,122.856c8.904,7.688 16.832,22.872 16.832,46.112c0,33.296 -0.296,60.128 -0.296,68.296c0,5.872 3.496,12.568 12.92,12.408C322.488,479.555 322.712,455.659 322.712,426.899z"
23+
android:fillColor="#ffffff"/>
24+
<path
25+
android:pathData="M117.464,423.995c5.208,10.72 22.712,36.4 68.888,30.992c-0.064,-5.648 -0.112,-11.976 -0.144,-18.928C150.584,443.835 129.552,434.667 117.464,423.995z"
26+
android:fillColor="#ffffff"/>
27+
<path
28+
android:pathData="M126.368,391.387c-1.592,-2.4 -4.576,-6.472 -8.904,-10.544C120.272,385.011 123.256,388.507 126.368,391.387z"
29+
android:fillColor="#ffffff"/>
30+
</vector>

0 commit comments

Comments
 (0)