1
0
mirror of https://github.com/tateisu/SubwayTooter synced 2024-12-25 00:21:26 +01:00

アプリ情報から開発者のプロフへの導線を追加

This commit is contained in:
tateisu 2017-04-26 10:35:23 +09:00
parent b9a4f6f41a
commit 2111d1cbe0
5 changed files with 58 additions and 11 deletions

View File

@ -14,6 +14,7 @@
<w>reblogs</w>
<w>subwaytooter</w>
<w>swipy</w>
<w>tateisu</w>
<w>timelines</w>
<w>unfavourite</w>
<w>unfollow</w>

View File

@ -13,8 +13,11 @@ import android.widget.TextView;
public class ActAbout extends AppCompatActivity {
static final String EXTRA_SEARCH = "search";
static final String url_store = "https://play.google.com/store/apps/details?id=jp.juggler.subwaytooter";
static final String url_enty = "https://enty.jp/3WtlzHG10wZv";
static final String developer_acct = "tateisu@mastodon.juggler.jp";
@Override protected void onCreate( @Nullable Bundle savedInstanceState ){
super.onCreate( savedInstanceState );
@ -26,8 +29,20 @@ public class ActAbout extends AppCompatActivity {
}catch( PackageManager.NameNotFoundException ex ){
ex.printStackTrace();
}
Button b;
Button b = (Button) findViewById( R.id.btnRate );
b = (Button) findViewById( R.id.btnDeveloper );
b.setText( developer_acct );
b.setOnClickListener( new View.OnClickListener() {
@Override public void onClick( View v ){
Intent data = new Intent();
data.putExtra(EXTRA_SEARCH,developer_acct);
setResult( RESULT_OK,data );
finish();
}
} );
b = (Button) findViewById( R.id.btnRate );
b.setText( url_store );
b.setOnClickListener( new View.OnClickListener() {
@Override public void onClick( View v ){

View File

@ -147,6 +147,7 @@ public class ActMain extends AppCompatActivity
static final int REQUEST_CODE_COLUMN_LIST = 1;
static final int REQUEST_CODE_ACCOUNT_SETTING = 2;
static final int REQUEST_APP_ABOUT = 3;
@Override
protected void onActivityResult( int requestCode, int resultCode, Intent data ){
@ -173,6 +174,14 @@ public class ActMain extends AppCompatActivity
startAccessTokenUpdate( data );
return;
}
}else if( requestCode == REQUEST_APP_ABOUT ){
if( data != null ){
String search = data.getStringExtra( ActAbout.EXTRA_SEARCH );
if( ! TextUtils.isEmpty( search ) ){
performAddTimeline( Column.TYPE_SEARCH, search, true );
}
return;
}
}
}
super.onActivityResult( requestCode, resultCode, data );
@ -277,7 +286,7 @@ public class ActMain extends AppCompatActivity
performColumnList();
}else if( id == R.id.nav_add_tl_search ){
performAddTimeline( Column.TYPE_SEARCH );
performAddTimeline( Column.TYPE_SEARCH, "", false );
}else if( id == R.id.nav_app_about ){
openAppAbout();
@ -670,16 +679,16 @@ public class ActMain extends AppCompatActivity
addColumn( access_info, Column.TYPE_CONVERSATION, status.id );
}
private void performAddTimeline( final int type ){
private void performAddTimeline( final int type, final Object... args ){
AccountPicker.pick( this, true, new AccountPicker.AccountPickerCallback() {
@Override
public void onAccountPicked( SavedAccount ai ){
@Override public void onAccountPicked( SavedAccount ai ){
switch( type ){
default:
addColumn( ai, type, ai.id );
addColumn( ai, type, args );
break;
case Column.TYPE_SEARCH:
addColumn( ai, type, "", false );
case Column.TYPE_PROFILE:
addColumn( ai, type, ai.id );
break;
}
}
@ -1398,7 +1407,7 @@ public class ActMain extends AppCompatActivity
if( result == null ){
// cancelled.
}else if( who != null ){
// App1.relationship_map.addFollowing( access_info, who.id );
// if( callback != null )
// callback.onRelationChanged( App1.relationship_map.get( access_info, who.id ) );
@ -1861,7 +1870,7 @@ public class ActMain extends AppCompatActivity
}
private void openAppAbout(){
startActivity( new Intent( this, ActAbout.class ) );
startActivityForResult( new Intent( this, ActAbout.class ), REQUEST_APP_ABOUT );
}
}

View File

@ -51,6 +51,27 @@
android:layout_weight="0.2"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/developer"
/>
<Button
android:id="@+id/btnDeveloper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_bg_transparent"
android:padding="8dp"
tools:text="tateisu@mastodon.juggler.jp"
android:textAllCaps="false"
/>
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="0.2"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -63,7 +84,7 @@
android:layout_height="wrap_content"
android:background="@drawable/btn_bg_transparent"
android:padding="8dp"
android:text="@string/rate_on_store"
tools:text="rate_on_store"
android:textAllCaps="false"
/>

View File

@ -155,4 +155,5 @@
<string name="prior_local_url_when_open_attachment">prior local URL when open attachment</string>
<string name="disable_fast_scroller">disable fast scroller (app restart required)</string>
<string name="delete_succeeded">delete succeeded</string>
<string name="developer">developer</string>
</resources>