Skip to content
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
15 changes: 9 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.0.0'
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.5.0'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.17.0'
classpath 'com.android.tools.build:gradle:8.1.0'
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.8.20'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.25.3'
}
}

Expand All @@ -18,9 +18,12 @@ allprojects {
google()
mavenCentral()
}
plugins.withId("com.vanniktech.maven.publish") {
mavenPublish {
sonatypeHost = "S01"

configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.jetbrains.kotlin') {
details.useVersion "1.8.10"
}
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ plugins {
}

android {
compileSdk 30
namespace "io.github.muddz.styleabletoast.demo"
compileSdk 34

defaultConfig {
applicationId "io.github.muddz.styleabletoast.demo"
minSdk 16
targetSdk 30
minSdk 21
targetSdk 34
versionCode 1
versionName "1.0"
}
Expand All @@ -26,8 +27,7 @@ android {
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'io.github.muddz:styleabletoast:2.4.0'
// implementation project(':styleabletoast')
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation project(':styleabletoast')
}
3 changes: 2 additions & 1 deletion demo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

<activity
android:name="io.github.muddz.styleabletoast.demo.MainActivity"
android:screenOrientation="portrait">
android:screenOrientation="portrait"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
11 changes: 5 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
An Android library that takes the standard toast to the next level with many styling options. Style your toasts either by code or with a style in `styles.xml`.
## Cases

<img src="https://github.com/Muddz/StyleableToast/blob/master/cases.png" width="75%">
<img src="https://github.com/Muddz/StyleableToast/blob/master/cases.png" width="75%" alt="Toast cases">


## Example with a style

1) Define a style in `styles.xml`. All available attributes:
1. Define a style in `styles.xml`. All available attributes:
```xml
<style name="mytoast">
<item name="stTextBold">true</item>
Expand All @@ -23,14 +23,13 @@ An Android library that takes the standard toast to the next level with many sty
<item name="stStrokeColor">#fff</item>
<item name="stIconStart">@drawable/ic</item>
<item name="stIconEnd">@drawable/ic</item>
<item name="stLength">LONG</item> LONG or SHORT
<item name="stGravity">top</item> top or center
<item name="stLength">LONG</item>
<item name="stGravity">top</item>
<item name="stRadius">5dp</item>
</style>

```

2) Pass your style in the static constructor and call `show();`
2. Pass your style in the static constructor and call `show();`

```java
StyleableToast.makeText(context, "Hello World!", Toast.LENGTH_LONG, R.style.mytoast).show();
Expand Down
9 changes: 5 additions & 4 deletions styleabletoast/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ plugins {
}

android {
compileSdk 30
namespace "io.github.muddz.styleabletoast"
compileSdk 34

defaultConfig {
minSdk 16
targetSdk 30
minSdk 21
targetSdk 34
}
buildTypes {
release {
Expand All @@ -19,5 +20,5 @@ android {
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
}