get rid of Main activity. Next release I need to find a way at launch

time to choose between dual-pane and regular mode that doesn't mess
up sending Intents and make it harder to prevent there being
multiple instances of activities that are supposed to be single-top.
This commit is contained in:
Eric House 2016-06-26 14:28:17 -07:00
parent 6c5b5489ad
commit e703ae7ec5
10 changed files with 279 additions and 371 deletions

View file

@ -69,7 +69,7 @@
android:name=".XWApp" android:name=".XWApp"
> >
<activity android:name="Main" <activity android:name="GamesListActivity"
android:label="@string/app_name" android:label="@string/app_name"
android:launchMode="standard" android:launchMode="standard"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
@ -86,13 +86,6 @@
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="FragActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
/>
<activity android:name="GamesListActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
/>
<activity android:name="DictsActivity" <activity android:name="DictsActivity"
android:label="@string/title_dicts_list" android:label="@string/title_dicts_list"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"

File diff suppressed because it is too large Load diff

View file

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FF000007"
>
<!-- probably want some explanatory text here -->
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF000000"
>
<Button android:id="@+id/activity_button"
android:text="@string/activity_button"
style="@style/evenly_spaced_horizontal"
/>
<Button android:id="@+id/fragment_button"
android:text="@string/fragment_button"
style="@style/evenly_spaced_horizontal"
/>
</LinearLayout>
</LinearLayout>

View file

@ -67,6 +67,7 @@
<string name="key_summary_field">key_summary_field</string> <string name="key_summary_field">key_summary_field</string>
<string name="key_default_loc">key_default_loc</string> <string name="key_default_loc">key_default_loc</string>
<string name="key_force_tablet">key_force_tablet</string> <string name="key_force_tablet">key_force_tablet</string>
<!-- <string name="key_enable_dualpane">key_enable_dualpane</string> -->
<string name="key_force_radio">key_force_radio</string> <string name="key_force_radio">key_force_radio</string>
<string name="key_addrs_pref">key_addrs_pref</string> <string name="key_addrs_pref">key_addrs_pref</string>

View file

@ -2392,9 +2392,8 @@
<string name="force_tablet_title">Force tablet layout</string> <string name="force_tablet_title">Force tablet layout</string>
<string name="force_tablet_summary">Even if my screen is too small</string> <string name="force_tablet_summary">Even if my screen is too small</string>
<!-- <string name="enable_dualpane_title">Enable dualpane</string> -->
<string name="activity_button">Single-pane</string> <!-- <string name="enable_dualpane_summary">Side-by-side views, very experimental!</string> -->
<string name="fragment_button">Dual-pane</string>
<!-- Nagging: title of notification reminder message --> <!-- Nagging: title of notification reminder message -->
<string name="nag_title">Reminder: It\'s your turn</string> <string name="nag_title">Reminder: It\'s your turn</string>
@ -2593,6 +2592,7 @@
<string name="pref_group_relay_title">Relay Stuff</string> <string name="pref_group_relay_title">Relay Stuff</string>
<string name="pref_group_relay_summary">Prefs related to play via internet/relay</string> <string name="pref_group_relay_summary">Prefs related to play via internet/relay</string>
<string name="pref_group_l10n_title">Localization Stuff</string> <string name="pref_group_l10n_title">Localization Stuff</string>
<!-- <string name="pref_group_tablets_title">Tablets Stuff</string> -->
<string name="pref_group_l10n_summary">Prefs related to in-app localization</string> <string name="pref_group_l10n_summary">Prefs related to in-app localization</string>
<string name="pref_item_update_title">Update between releases</string> <string name="pref_item_update_title">Update between releases</string>
<string name="pref_item_update_summary">Get intermediate builds</string> <string name="pref_item_update_summary">Get intermediate builds</string>

View file

@ -423,6 +423,20 @@
/> />
</PreferenceScreen> </PreferenceScreen>
<!-- <PreferenceScreen android:title="@string/pref_group_tablets_title" -->
<!-- > -->
<!-- <CheckBoxPreference android:key="@string/key_enable_dualpane" -->
<!-- android:title="@string/enable_dualpane_title" -->
<!-- android:summary="@string/enable_dualpane_summary" -->
<!-- android:defaultValue="false" -->
<!-- /> -->
<!-- <CheckBoxPreference android:key="@string/key_force_tablet" -->
<!-- android:title="@string/force_tablet_title" -->
<!-- android:summary="@string/force_tablet_summary" -->
<!-- android:defaultValue="false" -->
<!-- /> -->
<!-- </PreferenceScreen> -->
<PreferenceScreen android:title="@string/pref_group_l10n_title" <PreferenceScreen android:title="@string/pref_group_l10n_title"
android:summary="@string/pref_group_l10n_summary" android:summary="@string/pref_group_l10n_summary"
> >
@ -445,12 +459,6 @@
</PreferenceScreen> </PreferenceScreen>
<CheckBoxPreference android:key="@string/key_force_tablet"
android:title="@string/force_tablet_title"
android:summary="@string/force_tablet_summary"
android:defaultValue="false"
/>
<!-- For broken devices like my Blaze 4G that report a download <!-- For broken devices like my Blaze 4G that report a download
directory that doesn't exist, allow users to set it. Mine: directory that doesn't exist, allow users to set it. Mine:
/sdcard/external_sd/download /sdcard/external_sd/download

View file

@ -2054,8 +2054,8 @@
tahw\'s elbaliava.</string> tahw\'s elbaliava.</string>
<string name="force_tablet_title">Ecrof telbat tuoyal</string> <string name="force_tablet_title">Ecrof telbat tuoyal</string>
<string name="force_tablet_summary">Neve fi ym neercs si oot llams</string> <string name="force_tablet_summary">Neve fi ym neercs si oot llams</string>
<string name="activity_button">Enap-elgnis</string> <!-- <string name="enable_dualpane_title">Enable dualpane</string> -->
<string name="fragment_button">Enap-laud</string> <!-- <string name="enable_dualpane_summary">Side-by-side views, very experimental!</string> -->
<!-- Nagging: title of notification reminder message --> <!-- Nagging: title of notification reminder message -->
<string name="nag_title">Rednimer: Ti\'s ruoy nrut</string> <string name="nag_title">Rednimer: Ti\'s ruoy nrut</string>
<!-- body of warning notification reminder message. First three <!-- body of warning notification reminder message. First three
@ -2224,6 +2224,7 @@
<string name="pref_group_relay_title">Yaler Ffuts</string> <string name="pref_group_relay_title">Yaler Ffuts</string>
<string name="pref_group_relay_summary">Sferp detaler ot yalp aiv yaler/tenretni</string> <string name="pref_group_relay_summary">Sferp detaler ot yalp aiv yaler/tenretni</string>
<string name="pref_group_l10n_title">Noitazilacol Ffuts</string> <string name="pref_group_l10n_title">Noitazilacol Ffuts</string>
<!-- <string name="pref_group_tablets_title">Tablets Stuff</string> -->
<string name="pref_group_l10n_summary">Sferp detaler ot ppa-ni noitazilacol</string> <string name="pref_group_l10n_summary">Sferp detaler ot ppa-ni noitazilacol</string>
<string name="pref_item_update_title">Etadpu neewteb sesaeler</string> <string name="pref_item_update_title">Etadpu neewteb sesaeler</string>
<string name="pref_item_update_summary">Teg etaidemretni sdliub</string> <string name="pref_item_update_summary">Teg etaidemretni sdliub</string>

View file

@ -2054,8 +2054,8 @@
WHAT\'S AVAILABLE.</string> WHAT\'S AVAILABLE.</string>
<string name="force_tablet_title">FORCE TABLET LAYOUT</string> <string name="force_tablet_title">FORCE TABLET LAYOUT</string>
<string name="force_tablet_summary">EVEN IF MY SCREEN IS TOO SMALL</string> <string name="force_tablet_summary">EVEN IF MY SCREEN IS TOO SMALL</string>
<string name="activity_button">SINGLE-PANE</string> <!-- <string name="enable_dualpane_title">Enable dualpane</string> -->
<string name="fragment_button">DUAL-PANE</string> <!-- <string name="enable_dualpane_summary">Side-by-side views, very experimental!</string> -->
<!-- Nagging: title of notification reminder message --> <!-- Nagging: title of notification reminder message -->
<string name="nag_title">REMINDER: IT\'S YOUR TURN</string> <string name="nag_title">REMINDER: IT\'S YOUR TURN</string>
<!-- body of warning notification reminder message. First three <!-- body of warning notification reminder message. First three
@ -2224,6 +2224,7 @@
<string name="pref_group_relay_title">RELAY STUFF</string> <string name="pref_group_relay_title">RELAY STUFF</string>
<string name="pref_group_relay_summary">PREFS RELATED TO PLAY VIA INTERNET/RELAY</string> <string name="pref_group_relay_summary">PREFS RELATED TO PLAY VIA INTERNET/RELAY</string>
<string name="pref_group_l10n_title">LOCALIZATION STUFF</string> <string name="pref_group_l10n_title">LOCALIZATION STUFF</string>
<!-- <string name="pref_group_tablets_title">Tablets Stuff</string> -->
<string name="pref_group_l10n_summary">PREFS RELATED TO IN-APP LOCALIZATION</string> <string name="pref_group_l10n_summary">PREFS RELATED TO IN-APP LOCALIZATION</string>
<string name="pref_item_update_title">UPDATE BETWEEN RELEASES</string> <string name="pref_item_update_title">UPDATE BETWEEN RELEASES</string>
<string name="pref_item_update_summary">GET INTERMEDIATE BUILDS</string> <string name="pref_item_update_summary">GET INTERMEDIATE BUILDS</string>

View file

@ -1,63 +0,0 @@
/* -*- compile-command: "find-and-ant.sh debug install"; -*- */
/*
* Copyright 2014 - 2016 by Eric House (xwords@eehouse.org). All rights
* reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.eehouse.android.xw4;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View.OnClickListener;
import android.view.View;
public class Main extends Activity {
@Override
public void onCreate( Bundle savedInstanceState )
{
super.onCreate( savedInstanceState );
if ( BuildConfig.DEBUG && getResources().getBoolean(R.bool.dualpane_enabled) ) {
setContentView( R.layout.main );
findViewById( R.id.activity_button )
.setOnClickListener( new OnClickListener() {
@Override
public void onClick( View v ) {
startActivity( GamesListActivity.class );
}
} );
findViewById( R.id.fragment_button )
.setOnClickListener( new OnClickListener() {
@Override
public void onClick( View v ) {
startActivity( FragActivity.class );
}
} );
} else {
startActivity( GamesListActivity.class );
finish();
}
}
private void startActivity( Class clazz )
{
startActivity( new Intent( this, clazz ) );
}
}

View file

@ -17,7 +17,6 @@ DEVICES=''
DIRNAME=$(basename $(pwd)) DIRNAME=$(basename $(pwd))
ADB="$(which adb)" ADB="$(which adb)"
MAIN=GamesListActivity MAIN=GamesListActivity
MAIN=Main
case $DIRNAME in case $DIRNAME in
XWords4-dbg) XWords4-dbg)