Skip to content

Commit 2a4eabc

Browse files
authored
Migrate library to Maven Central (#50)
* Update gradle dependencies * Fix styles * Update changelog * Update gradle.wrapper * Update maven publish plugin * Add scripts to release library on mavenCentral()
1 parent b4be12e commit 2a4eabc

File tree

18 files changed

+268
-101
lines changed

18 files changed

+268
-101
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Changelog
2+
3+
## Version 1.1.2
4+
- Migrate library from JCenter to Maven Central
5+
- Update targetSdkVersion to 29
6+
- Fix warnings
7+
8+
## Version 1.1.1
9+
- Update dependencies to AndroidX
10+
- Dark mode support

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Add it as a dependency in your app's build.gradle file
9999

100100
```groovy
101101
dependencies {
102-
compile 'com.codemybrainsout.rating:ratingdialog:1.0.8'
102+
implementation 'com.codemybrainsout.rating:ratingdialog:1.1.0'
103103
}
104104
```
105105

app/build.gradle

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 29
5-
buildToolsVersion "29.0.1"
4+
compileSdkVersion 30
5+
buildToolsVersion "30.0.3"
66

77
defaultConfig {
88
applicationId "com.codemybrainsout.rating"
99
minSdkVersion 15
10-
targetSdkVersion 29
10+
targetSdkVersion 30
1111
versionCode 1
1212
versionName "1.0"
13-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
13+
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
1414
}
1515
buildTypes {
1616
release {
@@ -21,13 +21,13 @@ android {
2121
}
2222

2323
dependencies {
24-
compile fileTree(dir: 'libs', include: ['*.jar'])
25-
androidTestCompile('androidx.test.espresso:espresso-core:3.1.0', {
24+
implementation fileTree(dir: 'libs', include: ['*.jar'])
25+
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
2626
exclude group: 'com.android.support', module: 'support-annotations'
2727
})
2828

29-
compile 'com.google.android.material:material:1.0.0'
30-
compile 'androidx.appcompat:appcompat:1.0.0'
31-
testCompile 'junit:junit:4.12'
32-
compile project(':ratingdialog')
29+
implementation 'com.google.android.material:material:1.3.0'
30+
implementation "androidx.appcompat:appcompat:1.2.0"
31+
testImplementation 'junit:junit:4.13.2'
32+
implementation project(':ratingdialog')
3333
}

app/src/main/java/com/codemybrainsout/rating/MainActivity.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@
99

1010
import com.codemybrainsout.ratingdialog.RatingDialog;
1111

12+
import androidx.appcompat.app.AppCompatActivity;
13+
1214
public class MainActivity extends AppCompatActivity {
1315

1416
private static final String TAG = MainActivity.class.getSimpleName();
15-
private RelativeLayout rlRate;
1617

1718
@Override
1819
protected void onCreate(Bundle savedInstanceState) {
1920
super.onCreate(savedInstanceState);
2021
setContentView(R.layout.activity_main);
2122

22-
rlRate = (RelativeLayout) findViewById(R.id.rlRate);
23+
RelativeLayout rlRate = findViewById(R.id.rlRate);
2324
rlRate.setOnClickListener(new View.OnClickListener() {
2425
@Override
2526
public void onClick(View view) {
@@ -31,8 +32,8 @@ public void onClick(View view) {
3132
private void showDialog() {
3233

3334
final RatingDialog ratingDialog = new RatingDialog.Builder(this)
34-
.session(1)
35-
.threshold(4)
35+
//.session(3)
36+
.threshold(3)
3637
.ratingBarColor(R.color.yellow)
3738
.playstoreUrl("https://github.com/codemybrainsout/smart-app-rate")
3839
.onRatingBarFormSumbit(new RatingDialog.Builder.RatingDialogFormListener() {

app/src/main/res/layout/activity_main.xml

Lines changed: 47 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools"
4+
xmlns:app="http://schemas.android.com/apk/res-auto"
45
android:id="@+id/activity_main"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
@@ -11,7 +12,7 @@
1112
<com.google.android.material.appbar.AppBarLayout
1213
android:layout_width="match_parent"
1314
android:layout_height="?android:attr/actionBarSize"
14-
android:elevation="4dp">
15+
app:elevation="4dp">
1516

1617
<RelativeLayout
1718
android:layout_width="match_parent"
@@ -22,14 +23,15 @@
2223
android:layout_height="wrap_content"
2324
android:layout_centerVertical="true"
2425
android:layout_marginLeft="15dp"
25-
android:src="@drawable/ic_menu" />
26+
android:src="@drawable/ic_menu"
27+
android:layout_marginStart="15dp" />
2628

2729
<TextView
2830
android:layout_width="wrap_content"
2931
android:layout_height="wrap_content"
3032
android:layout_centerInParent="true"
3133
android:layout_gravity="center"
32-
android:text="Settings"
34+
android:text="@string/settings"
3335
android:textColor="@android:color/black"
3436
android:textSize="20sp" />
3537
</RelativeLayout>
@@ -42,7 +44,7 @@
4244

4345
<LinearLayout
4446
android:layout_width="match_parent"
45-
android:layout_height="match_parent"
47+
android:layout_height="wrap_content"
4648
android:orientation="vertical">
4749

4850
<RelativeLayout
@@ -52,12 +54,13 @@
5254
android:background="@android:color/white"
5355
android:clickable="true"
5456
android:foreground="?attr/selectableItemBackground"
55-
android:padding="15dp">
57+
android:padding="15dp"
58+
android:focusable="true">
5659

5760
<TextView
5861
android:layout_width="wrap_content"
5962
android:layout_height="wrap_content"
60-
android:text="Edit Profile"
63+
android:text="@string/edit_profile"
6164
android:textColor="@android:color/black"
6265
android:textSize="16sp" />
6366

@@ -70,12 +73,13 @@
7073
android:background="@android:color/white"
7174
android:clickable="true"
7275
android:foreground="?attr/selectableItemBackground"
73-
android:padding="15dp">
76+
android:padding="15dp"
77+
android:focusable="true">
7478

7579
<TextView
7680
android:layout_width="wrap_content"
7781
android:layout_height="wrap_content"
78-
android:text="Your Status"
82+
android:text="@string/your_status"
7983
android:textColor="@android:color/black"
8084
android:textSize="16sp" />
8185

@@ -88,13 +92,14 @@
8892
android:background="@android:color/white"
8993
android:clickable="true"
9094
android:foreground="?attr/selectableItemBackground"
91-
android:padding="15dp">
95+
android:padding="15dp"
96+
android:focusable="true">
9297

9398
<TextView
9499
android:layout_width="wrap_content"
95100
android:layout_height="wrap_content"
96101
android:layout_centerVertical="true"
97-
android:text="Push Notifications"
102+
android:text="@string/push_notifications"
98103
android:textColor="@android:color/black"
99104
android:textSize="16sp" />
100105

@@ -103,7 +108,8 @@
103108
android:layout_height="wrap_content"
104109
android:layout_alignParentRight="true"
105110
android:layout_centerVertical="true"
106-
android:src="@drawable/ic_arrow" />
111+
android:src="@drawable/ic_arrow"
112+
android:layout_alignParentEnd="true" />
107113

108114
</RelativeLayout>
109115

@@ -114,13 +120,14 @@
114120
android:background="@android:color/white"
115121
android:clickable="true"
116122
android:foreground="?attr/selectableItemBackground"
117-
android:padding="15dp">
123+
android:padding="15dp"
124+
android:focusable="true">
118125

119126
<TextView
120127
android:layout_width="wrap_content"
121128
android:layout_height="wrap_content"
122129
android:layout_centerVertical="true"
123-
android:text="Do Not Disturb"
130+
android:text="@string/do_not_disturb"
124131
android:textColor="@android:color/black"
125132
android:textSize="16sp" />
126133

@@ -129,7 +136,8 @@
129136
android:layout_height="wrap_content"
130137
android:layout_alignParentRight="true"
131138
android:layout_centerVertical="true"
132-
android:src="@drawable/ic_arrow" />
139+
android:src="@drawable/ic_arrow"
140+
android:layout_alignParentEnd="true" />
133141

134142
</RelativeLayout>
135143

@@ -140,13 +148,14 @@
140148
android:background="@android:color/white"
141149
android:clickable="true"
142150
android:foreground="?attr/selectableItemBackground"
143-
android:padding="15dp">
151+
android:padding="15dp"
152+
android:focusable="true">
144153

145154
<TextView
146155
android:layout_width="wrap_content"
147156
android:layout_height="wrap_content"
148157
android:layout_centerVertical="true"
149-
android:text="Advanced"
158+
android:text="@string/advanced"
150159
android:textColor="@android:color/black"
151160
android:textSize="16sp" />
152161

@@ -155,7 +164,8 @@
155164
android:layout_height="wrap_content"
156165
android:layout_alignParentRight="true"
157166
android:layout_centerVertical="true"
158-
android:src="@drawable/ic_arrow" />
167+
android:src="@drawable/ic_arrow"
168+
android:layout_alignParentEnd="true" />
159169

160170
</RelativeLayout>
161171

@@ -166,13 +176,14 @@
166176
android:background="@android:color/white"
167177
android:clickable="true"
168178
android:foreground="?attr/selectableItemBackground"
169-
android:padding="15dp">
179+
android:padding="15dp"
180+
android:focusable="true">
170181

171182
<TextView
172183
android:layout_width="wrap_content"
173184
android:layout_height="wrap_content"
174185
android:layout_centerVertical="true"
175-
android:text="Submit Feedback"
186+
android:text="@string/submit_feedback"
176187
android:textColor="@android:color/black"
177188
android:textSize="16sp" />
178189

@@ -181,7 +192,8 @@
181192
android:layout_height="wrap_content"
182193
android:layout_alignParentRight="true"
183194
android:layout_centerVertical="true"
184-
android:src="@drawable/ic_arrow" />
195+
android:src="@drawable/ic_arrow"
196+
android:layout_alignParentEnd="true" />
185197

186198
</RelativeLayout>
187199

@@ -193,13 +205,14 @@
193205
android:background="@android:color/white"
194206
android:clickable="true"
195207
android:foreground="?attr/selectableItemBackground"
196-
android:padding="15dp">
208+
android:padding="15dp"
209+
android:focusable="true">
197210

198211
<TextView
199212
android:layout_width="wrap_content"
200213
android:layout_height="wrap_content"
201214
android:layout_centerVertical="true"
202-
android:text="Rate Us"
215+
android:text="@string/rate_us"
203216
android:textColor="@android:color/black"
204217
android:textSize="16sp" />
205218

@@ -208,7 +221,8 @@
208221
android:layout_height="wrap_content"
209222
android:layout_alignParentRight="true"
210223
android:layout_centerVertical="true"
211-
android:src="@drawable/ic_arrow" />
224+
android:src="@drawable/ic_arrow"
225+
android:layout_alignParentEnd="true" />
212226

213227
</RelativeLayout>
214228

@@ -219,13 +233,14 @@
219233
android:background="@android:color/white"
220234
android:clickable="true"
221235
android:foreground="?attr/selectableItemBackground"
222-
android:padding="15dp">
236+
android:padding="15dp"
237+
android:focusable="true">
223238

224239
<TextView
225240
android:layout_width="wrap_content"
226241
android:layout_height="wrap_content"
227242
android:layout_centerVertical="true"
228-
android:text="Help"
243+
android:text="@string/help"
229244
android:textColor="@android:color/black"
230245
android:textSize="16sp" />
231246

@@ -234,7 +249,8 @@
234249
android:layout_height="wrap_content"
235250
android:layout_alignParentRight="true"
236251
android:layout_centerVertical="true"
237-
android:src="@drawable/ic_arrow" />
252+
android:src="@drawable/ic_arrow"
253+
android:layout_alignParentEnd="true" />
238254

239255
</RelativeLayout>
240256

@@ -246,13 +262,14 @@
246262
android:clickable="true"
247263
android:layout_marginBottom="15dp"
248264
android:foreground="?attr/selectableItemBackground"
249-
android:padding="15dp">
265+
android:padding="15dp"
266+
android:focusable="true">
250267

251268
<TextView
252269
android:layout_width="wrap_content"
253270
android:layout_height="wrap_content"
254271
android:layout_centerVertical="true"
255-
android:text="About"
272+
android:text="@string/about"
256273
android:textColor="@android:color/black"
257274
android:textSize="16sp" />
258275

@@ -261,13 +278,13 @@
261278
android:layout_height="wrap_content"
262279
android:layout_alignParentRight="true"
263280
android:layout_centerVertical="true"
264-
android:src="@drawable/ic_arrow" />
281+
android:src="@drawable/ic_arrow"
282+
android:layout_alignParentEnd="true" />
265283

266284
</RelativeLayout>
267285

268286
</LinearLayout>
269287

270288
</ScrollView>
271289

272-
273290
</LinearLayout>

app/src/main/res/values-night/styles.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<resources>
22

33
<!-- Base application theme. -->
4-
<style name="AppTheme" parent="Theme.AppCompat.DayNight">
4+
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
55
<!-- Customize your theme here. -->
66
<item name="colorPrimary">@color/colorPrimary</item>
77
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>

app/src/main/res/values/strings.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
<resources>
2-
<string name="app_name">Smart App Rate</string>
2+
<string name="app_name" translatable="false">Smart App Rate</string>
3+
<string name="settings" translatable="false">Settings</string>
4+
<string name="edit_profile" translatable="false">Edit Profile</string>
5+
<string name="your_status" translatable="false">Your Status</string>
6+
<string name="push_notifications" translatable="false">Push Notifications</string>
7+
<string name="do_not_disturb" translatable="false">Do Not Disturb</string>
8+
<string name="advanced" translatable="false">Advanced</string>
9+
<string name="submit_feedback" translatable="false">Submit Feedback</string>
10+
<string name="rate_us" translatable="false">Rate Us</string>
11+
<string name="help" translatable="false">Help</string>
12+
<string name="about" translatable="false">About</string>
313
</resources>

app/src/main/res/values/styles.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<resources>
22

33
<!-- Base application theme. -->
4-
<style name="AppTheme" parent="Theme.AppCompat.DayNight">
4+
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
55
<!-- Customize your theme here. -->
66
<item name="colorPrimary">@color/colorPrimary</item>
77
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>

0 commit comments

Comments
 (0)