Skip to content

Commit

Permalink
v0.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
tateisu committed Apr 28, 2017
1 parent b72353f commit 4b6f13e
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 15 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "jp.juggler.subwaytooter"
minSdkVersion 21
targetSdkVersion 25
versionCode 18
versionName "0.1.8"
versionCode 19
versionName "0.1.9"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

Expand Down
49 changes: 43 additions & 6 deletions app/src/main/java/jp/juggler/subwaytooter/ActAbout.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

public class ActAbout extends AppCompatActivity {
Expand All @@ -19,9 +20,13 @@ public class ActAbout extends AppCompatActivity {
static final String url_enty = "https://enty.jp/3WtlzHG10wZv";
static final String developer_acct = "tateisu@mastodon.juggler.jp";

static final String[] contributors = new String[]{
"@Balor@freeradical.zone", "update english language",
};

@Override protected void onCreate( @Nullable Bundle savedInstanceState ){
super.onCreate( savedInstanceState );
App1.setActivityTheme(this,false);
App1.setActivityTheme( this, false );
setContentView( R.layout.act_about );

try{
Expand All @@ -32,13 +37,13 @@ public class ActAbout extends AppCompatActivity {
}
Button b;

b = (Button) findViewById( R.id.btnDeveloper );
b.setText( getString(R.string.search_for,developer_acct ));
b = (Button) findViewById( R.id.btnDeveloper );
b.setText( getString( R.string.search_for, 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 );
data.putExtra( EXTRA_SEARCH, developer_acct );
setResult( RESULT_OK, data );
finish();
}
} );
Expand All @@ -50,14 +55,46 @@ public class ActAbout extends AppCompatActivity {
open_browser( url_store );
}
} );

b = (Button) findViewById( R.id.btnDonate );
b.setText( url_enty );
b.setOnClickListener( new View.OnClickListener() {
@Override public void onClick( View v ){
open_browser( url_enty );
}
} );

LinearLayout ll = (LinearLayout) findViewById( R.id.llContributors );
float density = getResources().getDisplayMetrics().density;
int margin_top = (int) ( 0.5f + density * 8 );
int padding = (int) ( 0.5f + density * 8 );

for( int i = 0, ie = contributors.length ; i < ie ; i += 2 ){
final String acct = contributors[ i ];
final String works = contributors[ i + 1 ];

b = new Button( this );
//
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT );
if( i < 0 ) lp.topMargin = margin_top;
b.setLayoutParams( lp );
//
b.setBackgroundResource( R.drawable.btn_bg_transparent );
b.setPadding( padding, padding, padding, padding );
b.setAllCaps( false );
//
b.setText( getString( R.string.search_for, acct ) + "\n" + getString( R.string.thanks_for, works ) );
b.setOnClickListener( new View.OnClickListener() {
@Override public void onClick( View v ){
Intent data = new Intent();
data.putExtra( EXTRA_SEARCH, acct );
setResult( RESULT_OK, data );
finish();
}
} );
//
ll.addView( b );
}
}

void open_browser( String url ){
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/java/jp/juggler/subwaytooter/ActMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,20 @@ protected void onActivityResult( int requestCode, int resultCode, Intent data ){
@Override
public void onBackPressed(){

// メニューが開いていたら閉じる
DrawerLayout drawer = (DrawerLayout) findViewById( R.id.drawer_layout );
if( drawer.isDrawerOpen( GravityCompat.START ) ){
drawer.closeDrawer( GravityCompat.START );
return;
}

// カラムが0個ならアプリを終了する
if( pager_adapter.getCount() == 0 ){
ActMain.this.finish();
return;
}

// カラムが1個以上ある場合は設定に合わせて挙動を変える
switch( pref.getInt( Pref.KEY_BACK_BUTTON_ACTION, 0 ) ){
default:
case ActAppSetting.BACK_ASK_ALWAYS:
Expand Down
34 changes: 27 additions & 7 deletions app/src/main/res/layout/act_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_height="8dp"
android:layout_weight="0.2"
/>

Expand All @@ -63,12 +63,13 @@
android:layout_height="wrap_content"
android:background="@drawable/btn_bg_transparent"
android:padding="8dp"
tools:text="tateisu@mastodon.juggler.jp"
android:textAllCaps="false"
tools:text="tateisu@mastodon.juggler.jp"
/>

<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_height="8dp"
android:layout_weight="0.2"
/>

Expand All @@ -84,13 +85,13 @@
android:layout_height="wrap_content"
android:background="@drawable/btn_bg_transparent"
android:padding="8dp"
tools:text="rate_on_store"
android:textAllCaps="false"
tools:text="rate_on_store"
/>

<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_height="8dp"
android:layout_weight="0.2"
/>

Expand All @@ -106,15 +107,34 @@
android:layout_height="wrap_content"
android:background="@drawable/btn_bg_transparent"
android:padding="8dp"
tools:text="enty...."
android:textAllCaps="false"
tools:text="enty...."
/>

<View
android:layout_width="0dp"
android:layout_height="8dp"
android:layout_weight="0.2"
/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/contributor"
/>

<LinearLayout
android:id="@+id/llContributors"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
/>

<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"
/>

</LinearLayout>
</ScrollView>
2 changes: 2 additions & 0 deletions app/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,6 @@
<string name="notification_delete">通知の削除</string>
<string name="search_for">%1$s を検索</string>
<string name="spoil_visibility_for_account">公開範囲をアカウントの既定値に狭めました</string>
<string name="contributor">contributor</string>
<string name="thanks_for">Thanks for %1$s</string>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,6 @@
<string name="confirm_delete_notification">This will empty your notification on your instance.\nAre you sure?</string>
<string name="search_for">Search %1$s</string>
<string name="spoil_visibility_for_account">Visibility is spoiled for account.</string>
<string name="contributor">contributor</string>
<string name="thanks_for">Thanks for %1$s</string>
</resources>

0 comments on commit 4b6f13e

Please sign in to comment.