diff --git a/.idea/dictionaries/tateisu.xml b/.idea/dictionaries/tateisu.xml index 62bb3cc6..e6745af9 100644 --- a/.idea/dictionaries/tateisu.xml +++ b/.idea/dictionaries/tateisu.xml @@ -14,6 +14,7 @@ reblogs subwaytooter swipy + tateisu timelines unfavourite unfollow diff --git a/app/src/main/java/jp/juggler/subwaytooter/ActAbout.java b/app/src/main/java/jp/juggler/subwaytooter/ActAbout.java index 14f50cc5..4dc685b2 100644 --- a/app/src/main/java/jp/juggler/subwaytooter/ActAbout.java +++ b/app/src/main/java/jp/juggler/subwaytooter/ActAbout.java @@ -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 ){ diff --git a/app/src/main/java/jp/juggler/subwaytooter/ActMain.java b/app/src/main/java/jp/juggler/subwaytooter/ActMain.java index 8c25702d..8cd87cd4 100644 --- a/app/src/main/java/jp/juggler/subwaytooter/ActMain.java +++ b/app/src/main/java/jp/juggler/subwaytooter/ActMain.java @@ -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 ); } } diff --git a/app/src/main/res/layout/act_about.xml b/app/src/main/res/layout/act_about.xml index 230ad46a..64285406 100644 --- a/app/src/main/res/layout/act_about.xml +++ b/app/src/main/res/layout/act_about.xml @@ -51,6 +51,27 @@ android:layout_weight="0.2" /> + + +