mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-28 07:58:08 +01:00
add not-again hints to all the buttons
This commit is contained in:
parent
e909e4b343
commit
39e502fe71
4 changed files with 67 additions and 33 deletions
|
@ -42,6 +42,12 @@
|
||||||
<string name="key_notagain_relay">key_notagain_relay</string>
|
<string name="key_notagain_relay">key_notagain_relay</string>
|
||||||
<string name="key_notagain_newgame">key_notagain_newgame</string>
|
<string name="key_notagain_newgame">key_notagain_newgame</string>
|
||||||
<string name="key_notagain_newgamenet">key_notagain_newgamenet</string>
|
<string name="key_notagain_newgamenet">key_notagain_newgamenet</string>
|
||||||
|
<string name="key_notagain_hintprev">key_notagain_hintprev</string>
|
||||||
|
<string name="key_notagain_hintnext">key_notagain_hintnext</string>
|
||||||
|
<string name="key_notagain_juggle">key_notagain_juggle</string>
|
||||||
|
<string name="key_notagain_flip">key_notagain_flip</string>
|
||||||
|
<string name="key_notagain_zoom">key_notagain_zoom</string>
|
||||||
|
<string name="key_notagain_undo">key_notagain_undo</string>
|
||||||
|
|
||||||
<string name="relayids_extra">org.eehouse.android.xw4.relayids_extra</string>
|
<string name="relayids_extra">org.eehouse.android.xw4.relayids_extra</string>
|
||||||
|
|
||||||
|
|
|
@ -416,6 +416,22 @@
|
||||||
the game, tap it; to change its configuration or for other
|
the game, tap it; to change its configuration or for other
|
||||||
options, long-tap it.</string>
|
options, long-tap it.</string>
|
||||||
|
|
||||||
|
<string name="not_again_hintprev">This button moves backwards
|
||||||
|
through the list of possible moves using tiles to the right of
|
||||||
|
the rack divider.</string>
|
||||||
|
<string name="not_again_hintnext">This button moves forward
|
||||||
|
through the list of possible moves using tiles to the right of
|
||||||
|
the rack divider.</string>
|
||||||
|
<string name="not_again_juggle">This button randomly rearranges
|
||||||
|
tiles in the rack.</string>
|
||||||
|
<string name="not_again_flip">This button flips the board across a
|
||||||
|
diagonal axis.</string>
|
||||||
|
<string name="not_again_zoom">This button toggles the board
|
||||||
|
between zoomed and regular size. Drag it when it is zoomed to
|
||||||
|
see parts that are hidden.</string>
|
||||||
|
<string name="not_again_undo">This button undos/redoes the current
|
||||||
|
turn.</string>
|
||||||
|
|
||||||
<string name="not_again_newgamenet">The new game you have created </string>
|
<string name="not_again_newgamenet">The new game you have created </string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -803,76 +803,76 @@ public class BoardActivity extends XWActivity implements UtilCtxt {
|
||||||
}
|
}
|
||||||
} // loadGame
|
} // loadGame
|
||||||
|
|
||||||
private void handleChatButton()
|
|
||||||
{
|
|
||||||
Runnable runnable = new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
showDialog( GET_MESSAGE );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
showNotAgainDlgThen( R.string.not_again_chat,
|
|
||||||
R.string.key_notagain_chat,
|
|
||||||
runnable );
|
|
||||||
}
|
|
||||||
|
|
||||||
private void populateToolbar()
|
private void populateToolbar()
|
||||||
{
|
{
|
||||||
m_toolbar.setListener( Toolbar.BUTTON_HINT_PREV,
|
m_toolbar.setListener( Toolbar.BUTTON_HINT_PREV,
|
||||||
new View.OnClickListener() {
|
R.string.not_again_hintprev,
|
||||||
@Override
|
R.string.key_notagain_hintprev,
|
||||||
public void onClick( View view ) {
|
new Runnable() {
|
||||||
|
public void run() {
|
||||||
m_jniThread.handle( JNIThread.JNICmd
|
m_jniThread.handle( JNIThread.JNICmd
|
||||||
.CMD_PREV_HINT );
|
.CMD_PREV_HINT );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
m_toolbar.setListener( Toolbar.BUTTON_HINT_NEXT,
|
m_toolbar.setListener( Toolbar.BUTTON_HINT_NEXT,
|
||||||
new View.OnClickListener() {
|
R.string.not_again_hintnext,
|
||||||
|
R.string.key_notagain_hintnext,
|
||||||
|
new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick( View view ) {
|
public void run() {
|
||||||
m_jniThread.handle( JNIThread.JNICmd
|
m_jniThread.handle( JNIThread.JNICmd
|
||||||
.CMD_NEXT_HINT );
|
.CMD_NEXT_HINT );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
m_toolbar.setListener( Toolbar.BUTTON_JUGGLE,
|
m_toolbar.setListener( Toolbar.BUTTON_JUGGLE,
|
||||||
new View.OnClickListener() {
|
R.string.not_again_juggle,
|
||||||
|
R.string.key_notagain_juggle,
|
||||||
|
new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick( View view ) {
|
public void run() {
|
||||||
m_jniThread.handle( JNIThread.JNICmd
|
m_jniThread.handle( JNIThread.JNICmd
|
||||||
.CMD_JUGGLE );
|
.CMD_JUGGLE );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
m_toolbar.setListener( Toolbar.BUTTON_FLIP,
|
m_toolbar.setListener( Toolbar.BUTTON_FLIP,
|
||||||
new View.OnClickListener() {
|
R.string.not_again_flip,
|
||||||
|
R.string.key_notagain_flip,
|
||||||
|
new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick( View view ) {
|
public void run() {
|
||||||
m_jniThread.handle( JNIThread.JNICmd
|
m_jniThread.handle( JNIThread.JNICmd
|
||||||
.CMD_FLIP );
|
.CMD_FLIP );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
m_toolbar.setListener( Toolbar.BUTTON_ZOOM,
|
m_toolbar.setListener( Toolbar.BUTTON_ZOOM,
|
||||||
new View.OnClickListener() {
|
R.string.not_again_zoom,
|
||||||
|
R.string.key_notagain_zoom,
|
||||||
|
new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick( View view ) {
|
public void run() {
|
||||||
m_jniThread.handle( JNIThread.JNICmd
|
m_jniThread.handle( JNIThread.JNICmd
|
||||||
.CMD_TOGGLEZOOM );
|
.CMD_TOGGLEZOOM );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
m_toolbar.setListener( Toolbar.BUTTON_UNDO,
|
m_toolbar.setListener( Toolbar.BUTTON_UNDO,
|
||||||
new View.OnClickListener() {
|
R.string.not_again_undo,
|
||||||
|
R.string.key_notagain_undo,
|
||||||
|
new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick( View view ) {
|
public void run() {
|
||||||
m_jniThread.handle( JNIThread.JNICmd
|
m_jniThread.handle( JNIThread.JNICmd
|
||||||
.CMD_UNDO_CUR );
|
.CMD_UNDO_CUR );
|
||||||
}
|
}
|
||||||
}) ;
|
});
|
||||||
m_toolbar.setListener( Toolbar.BUTTON_CHAT,
|
m_toolbar.setListener( Toolbar.BUTTON_CHAT,
|
||||||
new View.OnClickListener() {
|
R.string.not_again_chat,
|
||||||
|
R.string.key_notagain_chat,
|
||||||
|
new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick( View view ) {
|
public void run() {
|
||||||
handleChatButton();
|
showDialog( GET_MESSAGE );
|
||||||
}
|
}
|
||||||
}) ;
|
});
|
||||||
} // populateToolbar
|
} // populateToolbar
|
||||||
|
|
||||||
private DialogInterface.OnDismissListener makeODLforBlocking()
|
private DialogInterface.OnDismissListener makeODLforBlocking()
|
||||||
|
|
|
@ -23,6 +23,7 @@ package org.eehouse.android.xw4;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
|
@ -73,7 +74,7 @@ public class Toolbar {
|
||||||
R.id.chat_button_vertical ),
|
R.id.chat_button_vertical ),
|
||||||
};
|
};
|
||||||
|
|
||||||
private Activity m_activity;
|
private XWActivity m_activity;
|
||||||
private LinearLayout m_horLayout;
|
private LinearLayout m_horLayout;
|
||||||
private LinearLayout m_vertLayout;
|
private LinearLayout m_vertLayout;
|
||||||
|
|
||||||
|
@ -83,7 +84,7 @@ public class Toolbar {
|
||||||
};
|
};
|
||||||
private ORIENTATION m_curOrient = ORIENTATION.ORIENT_UNKNOWN;
|
private ORIENTATION m_curOrient = ORIENTATION.ORIENT_UNKNOWN;
|
||||||
|
|
||||||
public Toolbar( Activity activity, View horLayout, View vertLayout )
|
public Toolbar( XWActivity activity, View horLayout, View vertLayout )
|
||||||
{
|
{
|
||||||
m_activity = activity;
|
m_activity = activity;
|
||||||
m_horLayout = (LinearLayout)horLayout;
|
m_horLayout = (LinearLayout)horLayout;
|
||||||
|
@ -99,6 +100,17 @@ public class Toolbar {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setListener( int index, final int msgID, final int prefsKey,
|
||||||
|
final Runnable proc )
|
||||||
|
{
|
||||||
|
View.OnClickListener listener = new View.OnClickListener() {
|
||||||
|
public void onClick( View view ) {
|
||||||
|
m_activity.showNotAgainDlgThen( msgID, prefsKey, proc );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
setListener( index, listener );
|
||||||
|
}
|
||||||
|
|
||||||
public void orientChanged( boolean landscape )
|
public void orientChanged( boolean landscape )
|
||||||
{
|
{
|
||||||
if ( landscape && m_curOrient == ORIENTATION.ORIENT_LANDSCAPE ) {
|
if ( landscape && m_curOrient == ORIENTATION.ORIENT_LANDSCAPE ) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue