Merge branch 'android_branch' of ssh://maidu2/home/eehouse/src/git/repos/xwords into android_branch

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
This commit is contained in:
Eric House 2016-06-26 14:38:50 -07:00
commit 3651137016
16 changed files with 280 additions and 511 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

@ -90,12 +90,6 @@
<item name="android:layout_weight">1</item> <item name="android:layout_weight">1</item>
</style> </style>
<!-- <style name="spaced_buttons"> -->
<!-- <item name="android:layout_width">fill_parent</item> -->
<!-- <item name="android:layout_height">wrap_content</item> -->
<!-- <item name="android:layout_weight">1</item> -->
<!-- </style> -->
<style name="newgame_connicon"> <style name="newgame_connicon">
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>

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

@ -1165,9 +1165,6 @@ public class BTService extends XWService {
private void updateStatusOut( boolean success ) private void updateStatusOut( boolean success )
{ {
// Intent intent = GamesListDelegate.makeGameIDIntent( this, gameID );
// Utils.postNotification( this, intent, R.string.new_btmove_title,
// body, (int)rowid );
ConnStatusHandler ConnStatusHandler
.updateStatusOut( this, null, CommsConnType.COMMS_CONN_BT, success ); .updateStatusOut( this, null, CommsConnType.COMMS_CONN_BT, success );
} }

View file

@ -633,9 +633,6 @@ public class BoardDelegate extends DelegateBase
protected void onResume() protected void onResume()
{ {
super.onResume(); super.onResume();
// if( BuildConfig.DEBUG ) {
// GameUtils.postSelfNotification( m_activity, m_rowid );
// }
doResume( false ); doResume( false );
} }
@ -2124,125 +2121,6 @@ public class BoardDelegate extends DelegateBase
} }
} // resumeGame } // resumeGame
// private void loadGame( boolean isStart )
// {
// if ( null == m_jniGamePtr ) {
// try {
// String gameName = DBUtils.getName( m_activity, m_rowid );
// String[] dictNames;
// Assert.assertNull( m_gameLock );
// m_gameLock = m_jniThreadRef.getLock();
// if ( null == m_gameLock ) {
// dictNames = GameUtils.dictNames( m_activity, m_rowid );
// } else {
// dictNames = GameUtils.dictNames( m_activity, m_gameLock );
// }
// DictUtils.DictPairs pairs = DictUtils.openDicts( m_activity, dictNames );
// if ( pairs.anyMissing( dictNames ) ) {
// showDictGoneFinish();
// } else {
// if ( null == m_gameLock ) {
// m_gameLock = new GameLock( m_rowid, true ).lock();
// }
// // PENDING: there's no point in re-opening the game if
// // it's already open!
// byte[] stream = GameUtils.savedGame( m_activity, m_gameLock );
// m_gi = new CurGameInfo( m_activity );
// m_gi.setName( gameName );
// XwJNI.gi_from_stream( m_gi, stream );
// String langName = m_gi.langName();
// m_summary = DBUtils.getSummary( m_activity, m_gameLock );
// m_relayMissing = m_summary.relayConnectPending();
// setThis( this );
// m_jniGamePtr = XwJNI.initJNI( m_rowid );
// if ( m_gi.serverRole != DeviceRole.SERVER_STANDALONE ) {
// m_xport = new CommsTransport( m_activity, this, m_rowid,
// m_gi.serverRole );
// }
// CommonPrefs cp = CommonPrefs.get( m_activity );
// if ( null == stream ||
// ! XwJNI.game_makeFromStream( m_jniGamePtr, stream,
// m_gi, dictNames,
// pairs.m_bytes,
// pairs.m_paths, langName,
// m_utils, m_jniu,
// null, cp, m_xport ) ) {
// XwJNI.game_makeNewGame( m_jniGamePtr, m_gi, m_utils,
// m_jniu, null, cp, m_xport,
// dictNames, pairs.m_bytes,
// pairs.m_paths, langName );
// }
// m_jniThread = m_jniThreadRef.retain();
// // see http://stackoverflow.com/questions/680180/where-to-stop-\
// // destroy-threads-in-android-service-class
// // m_jniThread.setDaemonOnce( true ); // firing
// // m_jniThread.startOnce();
// m_view.startHandling( m_activity, m_jniThread, m_jniGamePtr, m_gi,
// m_connTypes );
// if ( null != m_xport ) {
// // informMissing should have been called by now
// Assert.assertNotNull( m_connTypes );
// m_xport.setReceiver( m_jniThread, m_handler );
// }
// handleViaThread( JNICmd.CMD_START );
// if ( !CommonPrefs.getHideTitleBar( m_activity ) ) {
// setTitle( GameUtils.getName( m_activity, m_rowid ) );
// }
// positionToolbar( isPortrait() );
// populateToolbar();
// adjustTradeVisibility();
// int flags = DBUtils.getMsgFlags( m_activity, m_rowid );
// if ( 0 != (GameSummary.MSG_FLAGS_CHAT & flags) ) {
// startChatActivity();
// }
// if ( m_overNotShown ) {
// boolean auto = false;
// if ( 0 != (GameSummary.MSG_FLAGS_GAMEOVER & flags) ) {
// m_gameOver = true;
// } else if ( DBUtils.gameOver( m_activity, m_rowid ) ) {
// m_gameOver = true;
// auto = true;
// }
// if ( m_gameOver ) {
// m_overNotShown = false;
// handleViaThread( JNICmd.CMD_POST_OVER, auto );
// }
// }
// if ( 0 != flags ) {
// DBUtils.setMsgFlags( m_rowid, GameSummary.MSG_FLAGS_NONE );
// }
// Utils.cancelNotification( m_activity, (int)m_rowid );
// if ( null != m_xport ) {
// warnIfNoTransport();
// trySendChats();
// tickle( isStart );
// tryInvites();
// }
// }
// } catch ( GameUtils.NoSuchGameException nsge ) {
// DbgUtils.loge( nsge );
// finish();
// }
// }
// } // loadGame
private void tickle( boolean force ) private void tickle( boolean force )
{ {
for ( Iterator<CommsConnType> iter = m_connTypes.iterator(); for ( Iterator<CommsConnType> iter = m_connTypes.iterator();

View file

@ -186,6 +186,7 @@ public class BoardView extends View implements BoardHandler, SyncedDraw {
width, height ); width, height );
} }
// @Override
// public void onSizeChanged( int width, int height, int oldWidth, int oldHeight ) // public void onSizeChanged( int width, int height, int oldWidth, int oldHeight )
// { // {
// DbgUtils.logf( "BoardView.onSizeChanged(): width: %d => %d; height: %d => %d", // DbgUtils.logf( "BoardView.onSizeChanged(): width: %d => %d; height: %d => %d",

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

@ -268,8 +268,6 @@ public class JNIThread extends Thread {
} catch ( java.lang.InterruptedException ie ) { } catch ( java.lang.InterruptedException ie ) {
DbgUtils.loge( ie ); DbgUtils.loge( ie );
} }
// m_jniGamePtr.release();
// m_jniGamePtr = null;
m_lock.unlock(); m_lock.unlock();
} }
@ -712,7 +710,6 @@ public class JNIThread extends Thread {
} }
m_jniGamePtr.release(); m_jniGamePtr.release();
m_jniGamePtr = null; m_jniGamePtr = null;
// XwJNI.threadDone();
} // run } // run
public void handleBkgrnd( JNICmd cmd, Object... args ) public void handleBkgrnd( JNICmd cmd, Object... args )

View file

@ -34,10 +34,4 @@ public class LocActivity extends XWActivity {
m_dlgt = new LocDelegate( this, savedInstanceState ); m_dlgt = new LocDelegate( this, savedInstanceState );
super.onCreate( savedInstanceState, m_dlgt ); super.onCreate( savedInstanceState, m_dlgt );
} // onCreate } // onCreate
// @Override
// public boolean onCreateOptionsMenu( Menu menu )
// {
// return m_dlgt.onCreateOptionsMenu( menu );
// }
} }

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)