-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the CHANGELOG.md as the lone source of release notes
- Loading branch information
Showing
6 changed files
with
41 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
app/src/main/java/com/boardgamegeek/pref/ChangeLogPreference.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.boardgamegeek.pref; | ||
|
||
import android.content.Context; | ||
import android.preference.Preference; | ||
import android.util.AttributeSet; | ||
|
||
import com.boardgamegeek.BuildConfig; | ||
import com.boardgamegeek.util.ActivityUtils; | ||
|
||
public class ChangeLogPreference extends Preference { | ||
public ChangeLogPreference(Context context) { | ||
super(context); | ||
} | ||
|
||
public ChangeLogPreference(Context context, AttributeSet attrs) { | ||
super(context, attrs); | ||
} | ||
|
||
public ChangeLogPreference(Context context, AttributeSet attrs, int defStyleAttr) { | ||
super(context, attrs, defStyleAttr); | ||
} | ||
|
||
@Override | ||
protected void onClick() { | ||
String changeLogUrl = String.format("https://github.com/ccomeaux/boardgamegeek4android/blob/%s/CHANGELOG.md", BuildConfig.BRANCH); | ||
ActivityUtils.link(getContext(), changeLogUrl); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 5 additions & 31 deletions
36
app/src/main/java/com/boardgamegeek/pref/VersionPreference.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,26 @@ | ||
package com.boardgamegeek.pref; | ||
|
||
import android.content.Context; | ||
import android.preference.DialogPreference; | ||
import android.support.annotation.NonNull; | ||
import android.text.Html; | ||
import android.text.method.LinkMovementMethod; | ||
import android.preference.Preference; | ||
import android.util.AttributeSet; | ||
import android.view.View; | ||
import android.widget.TextView; | ||
|
||
import com.boardgamegeek.R; | ||
import com.boardgamegeek.util.HelpUtils; | ||
import com.boardgamegeek.util.ListTagHandler; | ||
|
||
public class VersionPreference extends DialogPreference { | ||
public class VersionPreference extends Preference { | ||
public VersionPreference(Context context) { | ||
super(context); | ||
} | ||
|
||
public VersionPreference(Context context, AttributeSet attrs) { | ||
super(context, attrs); | ||
init(); | ||
} | ||
|
||
public VersionPreference(Context context, AttributeSet attrs, int defStyle) { | ||
super(context, attrs, defStyle); | ||
init(); | ||
} | ||
|
||
private void init() { | ||
setDialogTitle(""); | ||
setDialogLayoutResource(R.layout.dialog_about); | ||
setPositiveButtonText(R.string.close); | ||
setNegativeButtonText(""); | ||
} | ||
|
||
@Override | ||
public CharSequence getSummary() { | ||
return HelpUtils.getVersionName(getContext()); | ||
} | ||
|
||
@Override | ||
protected void onBindDialogView(@NonNull View view) { | ||
super.onBindDialogView(view); | ||
TextView nameAndVersionView = (TextView) view.findViewById(R.id.app_name_and_version); | ||
TextView aboutBodyView = (TextView) view.findViewById(R.id.about_body); | ||
|
||
nameAndVersionView.setText(Html.fromHtml(getContext().getString(R.string.pref_about_app_name_and_version, | ||
HelpUtils.getVersionName(getContext())))); | ||
aboutBodyView.setMovementMethod(new LinkMovementMethod()); | ||
aboutBodyView.setText(Html.fromHtml(getContext().getString(R.string.pref_about_body), null, | ||
new ListTagHandler())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters