Skip to content

Commit 70ebb9d

Browse files
author
jiro.aqua@gmail.com
committed
Jota+への導線バナーを追加
1 parent 9523689 commit 70ebb9d

File tree

4 files changed

+54
-3
lines changed

4 files changed

+54
-3
lines changed

res/drawable-hdpi/banner.png

21.8 KB
Loading

res/drawable-ja-hdpi/banner.png

24.4 KB
Loading

res/layout/history_view.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:orientation="vertical"
4+
android:layout_width="fill_parent"
5+
android:layout_height="fill_parent"
6+
>
7+
<Button
8+
android:id="@+id/banner"
9+
android:layout_width="288dip"
10+
android:layout_height="36dip"
11+
android:background="@drawable/banner"
12+
android:gravity="center_horizontal"
13+
/>
14+
<ScrollView
15+
android:id="@+id/ScrollView01"
16+
android:layout_width="wrap_content"
17+
android:layout_height="0dip"
18+
android:layout_weight="1"
19+
>
20+
<TextView
21+
android:id="@+id/message"
22+
android:layout_width="fill_parent"
23+
android:layout_height="wrap_content"
24+
android:textColor="#111"
25+
android:background="#EEE"
26+
27+
/>
28+
</ScrollView>
29+
30+
</LinearLayout>

src/jp/sblo/pandora/jota/SettingsActivity.java

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import java.util.Arrays;
1515
import java.util.HashMap;
1616

17+
import android.app.Activity;
1718
import android.app.AlertDialog;
1819
import android.content.Context;
1920
import android.content.DialogInterface;
@@ -42,6 +43,7 @@
4243
import android.preference.Preference.OnPreferenceClickListener;
4344
import android.text.TextUtils;
4445
import android.view.View;
46+
import android.widget.Button;
4547
import android.widget.EditText;
4648
import android.widget.SeekBar;
4749
import android.widget.TextView;
@@ -2226,7 +2228,7 @@ protected void onPause() {
22262228
mPs.getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
22272229
}
22282230

2229-
public static void showChangeLog(final Context context,boolean changelog)
2231+
public static void showChangeLog(final Activity context,boolean changelog)
22302232
{
22312233
int filename;
22322234
int title;
@@ -2252,8 +2254,27 @@ public static void showChangeLog(final Context context,boolean changelog)
22522254
e.printStackTrace();
22532255
}
22542256

2257+
View view = context.getLayoutInflater().inflate(R.layout.history_view, null);
2258+
2259+
TextView msgText = (TextView)view.findViewById(R.id.message);
2260+
msgText.setText( text );
2261+
2262+
Button banner = (Button)view.findViewById(R.id.banner);
2263+
banner.setOnClickListener(new View.OnClickListener() {
2264+
2265+
@Override
2266+
public void onClick(View v) {
2267+
Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse("market://details?id=jp.sblo.pandora.jota.plus"));
2268+
// Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse("https://sites.google.com/site/aquamarinepandora/jotaplus"));
2269+
try{
2270+
context.startActivity(intent);
2271+
}
2272+
catch(Exception e){}
2273+
}
2274+
});
2275+
22552276
AlertDialog.Builder builder = new AlertDialog.Builder(context)
2256-
.setMessage( text )
2277+
.setView( view )
22572278
.setTitle( title )
22582279
.setPositiveButton(R.string.label_ok, null);
22592280

@@ -2270,7 +2291,7 @@ public void onClick(DialogInterface dialog, int which) {
22702291
builder.show();
22712292
}
22722293

2273-
public static void showWelcomeMessage(Context context)
2294+
public static void showWelcomeMessage(Activity context)
22742295
{
22752296
if ( sLastVersion == -1 ){
22762297
// Do nothing

0 commit comments

Comments
 (0)