Skip to content

Commit a55feb9

Browse files
committed
Version 0.0.8
* Layout margin improvements. * Method updates.
1 parent 64480ea commit a55feb9

File tree

6 files changed

+61
-53
lines changed

6 files changed

+61
-53
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies {
1717
compile fileTree(dir: 'libs', include: ['*.jar'])
1818
1919
// Add this dependency.
20-
compile 'uk.co.hassie:version-info-material-dialog:0.0.7'
20+
compile 'uk.co.hassie:version-info-material-dialog:0.0.8'
2121
}
2222
```
2323

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ buildscript {
2121
jcenter()
2222
}
2323
dependencies {
24-
classpath 'com.android.tools.build:gradle:2.3.0'
24+
classpath 'com.android.tools.build:gradle:2.3.1'
2525

2626
// NOTE: Do not place your application dependencies here; they belong
2727
// in the individual module build.gradle files

library/build.gradle

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,12 @@ android {
3232
defaultConfig {
3333
minSdkVersion 9
3434
targetSdkVersion 25
35-
versionCode 7
36-
versionName "0.0.7"
35+
versionCode 8
36+
versionName "0.0.8"
3737
}
3838
buildTypes {
3939
lintOptions {
4040
abortOnError false
41-
checkReleaseBuilds false
4241
}
4342
}
4443
}
@@ -52,7 +51,7 @@ dependencies {
5251
publish {
5352
groupId = 'uk.co.hassie'
5453
artifactId = 'version-info-material-dialog'
55-
publishVersion = '0.0.7'
54+
publishVersion = '0.0.8'
5655
desc = 'A simple Android library compatible all the way down to API 9, which shows a material dialog with version info for the app; using the same style as Googles version info dialogs'
5756
website = 'https://github.com/hassie-dash/version-info-material-dialog'
5857
}

library/src/main/java/uk/co/hassie/library/versioninfomdialog/VersionInfoMDialog.java

Lines changed: 46 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package uk.co.hassie.library.versioninfomdialog;
1818

1919
import android.content.Context;
20+
import android.content.DialogInterface;
2021
import android.content.pm.ApplicationInfo;
2122
import android.content.pm.PackageInfo;
2223
import android.content.pm.PackageManager;
@@ -39,39 +40,7 @@ public class VersionInfoMDialog{
3940
private CharSequence mVersionPrefix;
4041
private CharSequence mCopyrightText;
4142

42-
public static class Builder extends VersionInfoMDialog {
43-
44-
public Builder(Context context) {
45-
super.mContext = context;
46-
}
47-
48-
public Builder setCopyrightText(@NonNull CharSequence copyrightText) {
49-
super.mCopyrightText = copyrightText;
50-
return this;
51-
}
52-
53-
public Builder setCopyrightText(@StringRes int copyrightTextId) {
54-
if (copyrightTextId == 0)
55-
return this;
56-
super.mCopyrightText = super.mContext.getResources().getString(copyrightTextId);
57-
return this;
58-
}
59-
60-
public Builder setVersionPrefix(@NonNull CharSequence versionPrefixText) {
61-
super.mVersionPrefix = versionPrefixText;
62-
return this;
63-
}
64-
65-
public Builder setVersionPrefix(@StringRes int versionPrefixId) {
66-
if (versionPrefixId == 0)
67-
return this;
68-
super.mVersionPrefix = super.mContext.getResources().getString(versionPrefixId);
69-
return this;
70-
}
71-
72-
}
73-
74-
public VersionInfoMDialog build() {
43+
private VersionInfoMDialog build() {
7544

7645
LayoutInflater layoutInflater = LayoutInflater.from(mContext);
7746
View view = layoutInflater.inflate(R.layout.alert_dialog_version_info, null);
@@ -103,13 +72,10 @@ public VersionInfoMDialog build() {
10372

10473
appCopyright.setText(mCopyrightText);
10574

106-
AlertDialog alertDialog;
107-
alertDialog = new AlertDialog.Builder(mContext)
75+
mVersionInfoMaterialDialog = new AlertDialog.Builder(mContext)
10876
.setView(view)
10977
.create();
11078

111-
mVersionInfoMaterialDialog = alertDialog;
112-
11379
return this;
11480
}
11581

@@ -120,4 +86,47 @@ public VersionInfoMDialog show() {
12086
return this;
12187
}
12288

89+
public static class Builder extends VersionInfoMDialog {
90+
91+
public Builder(Context context) {
92+
super.mContext = context;
93+
}
94+
95+
public Builder setCopyrightText(@NonNull CharSequence copyright) {
96+
super.mCopyrightText = copyright;
97+
return this;
98+
}
99+
100+
public Builder setCopyrightText(@StringRes int copyrightResId) {
101+
if (copyrightResId == 0)
102+
return this;
103+
super.mCopyrightText = super.mContext.getResources().getString(copyrightResId);
104+
return this;
105+
}
106+
107+
public Builder setVersionPrefix(@NonNull CharSequence versionPrefix) {
108+
super.mVersionPrefix = versionPrefix;
109+
return this;
110+
}
111+
112+
public Builder setVersionPrefix(@StringRes int versionPrefixResId) {
113+
if (versionPrefixResId == 0)
114+
return this;
115+
super.mVersionPrefix = super.mContext.getResources().getString(versionPrefixResId);
116+
return this;
117+
}
118+
119+
public Builder build(){
120+
121+
super.build();
122+
return this;
123+
}
124+
125+
public Builder show() {
126+
super.show();
127+
return this;
128+
}
129+
130+
}
131+
123132
}

library/src/main/res/layout/alert_dialog_version_info.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@
3838
android:minHeight="8dp"
3939
android:minWidth="8dp"
4040
tools:ignore="ContentDescription"
41-
tools:src="@drawable/ic_launcher_round" />
41+
tools:src="@android:mipmap/sym_def_app_icon" />
4242

4343
<TextView
44+
android:id="@+id/txtAppName"
4445
android:layout_width="wrap_content"
4546
android:layout_height="wrap_content"
46-
android:id="@+id/txtAppName"
4747
android:layout_alignParentTop="true"
48-
android:layout_marginTop="20dp"
49-
android:layout_marginRight="25dp"
48+
android:layout_marginBottom="2dp"
5049
android:layout_marginEnd="25dp"
51-
android:layout_marginBottom="4dp"
52-
android:layout_toRightOf="@id/imgAppIcon"
50+
android:layout_marginRight="25dp"
51+
android:layout_marginTop="20dp"
5352
android:layout_toEndOf="@id/imgAppIcon"
53+
android:layout_toRightOf="@id/imgAppIcon"
5454
android:textAppearance="?android:attr/textAppearanceLarge"
5555
android:textSize="20sp"
5656
tools:text="App Name" />

sample/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ android {
2323
applicationId "uk.co.hassie.sample.library.versioninfomdialog"
2424
minSdkVersion 15
2525
targetSdkVersion 25
26-
versionCode 7
27-
versionName "0.0.7"
26+
versionCode 8
27+
versionName "0.0.8"
2828
}
2929
buildTypes {
3030
release {
@@ -40,7 +40,7 @@ android {
4040

4141
dependencies {
4242
compile fileTree(dir: 'libs', include: ['*.jar'])
43-
compile 'com.android.support:appcompat-v7:25.2.0'
44-
compile 'com.android.support:design:25.2.0'
43+
compile 'com.android.support:appcompat-v7:25.3.1'
44+
compile 'com.android.support:design:25.3.1'
4545
compile project(':library')
4646
}

0 commit comments

Comments
 (0)