ctrl k
  • #276 - Version number info in settings https://projects.tigase.org/issues/276

  • Loading...
  • bmalkow committed 1 decade ago
    ce0817a1
    1 parent 74e1e32c
  • res/layout/about_dialog.xml
    ■ ■ ■ ■ ■ ■
     1 +<?xml version="1.0" encoding="utf-8"?>
     2 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     3 + android:padding="5px" android:layout_width="wrap_content"
     4 + android:layout_height="wrap_content">
     5 + 
     6 + 
     7 + <ImageView android:id="@+id/image" android:layout_width="wrap_content"
     8 + android:src="@drawable/icon" android:layout_height="wrap_content"
     9 + android:layout_marginRight="10dp" />
     10 + 
     11 + 
     12 + <TextView android:text="@string/app_name" android:id="@+id/appNameText"
     13 + android:textColor="#FFF" android:layout_width="fill_parent"
     14 + android:gravity="center" android:layout_height="wrap_content"
     15 + android:layout_toRightOf="@+id/image" android:textSize="20sp"
     16 + android:textStyle="bold" />
     17 + 
     18 + <TextView android:text="@string/app_version" android:id="@+id/appVersionText"
     19 + android:layout_below="@+id/appNameText" android:textColor="#FFF"
     20 + android:gravity="center" android:layout_width="fill_parent"
     21 + android:layout_height="wrap_content" android:layout_toRightOf="@+id/image" />
     22 + 
     23 + <Button android:layout_height="wrap_content"
     24 + android:text="@android:string/ok"
     25 + android:layout_width="120sp"
     26 + android:id="@+id/okButton"
     27 + android:layout_below="@+id/appVersionText"
     28 + android:layout_marginTop="15sp"
     29 + android:layout_centerHorizontal="true"></Button>
     30 + 
     31 + 
     32 +</RelativeLayout>
  • res/menu/main_menu.xml
    ■ ■ ■ ■ ■ ■
    skipped 8 lines
    9 9   android:title="@string/closeChatButton" android:id="@+id/closeChatButton"></item>
    10 10   <item
    11 11   android:title="@string/showChatsButton" android:id="@+id/showChatsButton"></item>
     12 + <item
     13 + android:title="@string/aboutButton" android:icon="@android:drawable/ic_menu_info_details" android:id="@+id/aboutButton"></item>
    12 14   
    13 15  </menu>
    14 16   
  • res/values/strings.xml
    ■ ■ ■ ■ ■
    skipped 6 lines
    7 7   <string name="logoutButton">Disconnect</string>
    8 8   <string name="propertiesButton">Settings</string>
    9 9   <string name="preferencesTitle">Settings</string>
    10  - <string name="app_version">0.0.1a (2011-10-11)</string>
     10 + <string name="app_version">0.0.1a (2011-10-12)</string>
    11 11   <string name="closeChatButton">Close chat</string>
    12 12   <string name="chatSendButton">Send</string>
     13 + <string name="aboutButton">About</string>
    13 14   
    14 15   <string name="pref_login_section_title">Login data</string>
    15 16   <string name="pref_login_section_summary">Data needed to login to XMPP server</string>
    skipped 20 lines
  • src/org/tigase/mobile/JaxmppService.java
    ■ ■ ■ ■
    skipped 507 lines
    508 508   } else if (focused && pageIndex == -1) {
    509 509   Log.d(TAG, "Sending auto-away presence");
    510 510   focused = false;
    511  - int pr = prefs.getInt("auto_away_priority", 1);
     511 + int pr = prefs.getInt("auto_away_priority", 0);
    512 512   
    513 513   XmppService.jaxmpp().getModulesManager().getModule(PresenceModule.class).setPresence(Show.away, "Auto away", pr);
    514 514   }
    skipped 213 lines
  • src/org/tigase/mobile/TigaseMobileMessengerActivity.java
    ■ ■ ■ ■ ■ ■
    skipped 14 lines
    15 15  import tigase.jaxmpp.core.client.xmpp.modules.chat.MessageModule.MessageEvent;
    16 16  import tigase.jaxmpp.j2se.connectors.socket.SocketConnector;
    17 17  import android.app.Activity;
     18 +import android.app.Dialog;
    18 19  import android.content.BroadcastReceiver;
    19 20  import android.content.Context;
    20 21  import android.content.Intent;
    skipped 13 lines
    34 35  import android.view.MenuInflater;
    35 36  import android.view.MenuItem;
    36 37  import android.view.View;
     38 +import android.view.View.OnClickListener;
     39 +import android.widget.Button;
    37 40   
    38 41  public class TigaseMobileMessengerActivity extends FragmentActivity {
    39 42   
    skipped 115 lines
    155 158   }
    156 159   }
    157 160   
     161 + private final static int ABOUT_DIALOG = 1;
     162 + 
    158 163   public static final String CLIENT_FOCUS_MSG = "org.tigase.mobile.CLIENT_FOCUS_MSG";
    159 164   
    160 165   private static final boolean DEBUG = false;
    161 166   
    162 167   public static final int REQUEST_CHAT = 1;
    163 168   
    164  - public static final String ROSTER_CLICK_MSG = "org.tigase.mobile.ROSTER_CLICK_MSG";
    165  - 
    166 169   // private ListView rosterList;
     170 + 
     171 + public static final String ROSTER_CLICK_MSG = "org.tigase.mobile.ROSTER_CLICK_MSG";
    167 172   
    168 173   private static final String TAG = "tigase";
    169 174   
    skipped 178 lines
    348 353   }
    349 354   
    350 355   @Override
     356 + protected Dialog onCreateDialog(int id) {
     357 + switch (id) {
     358 + case ABOUT_DIALOG: {
     359 + 
     360 + final Dialog dialog = new Dialog(this);
     361 + dialog.setCancelable(true);
     362 + dialog.setCanceledOnTouchOutside(true);
     363 + 
     364 + dialog.setContentView(R.layout.about_dialog);
     365 + dialog.setTitle(getString(R.string.aboutButton));
     366 + 
     367 + Button okButton = (Button) dialog.findViewById(R.id.okButton);
     368 + okButton.setOnClickListener(new OnClickListener() {
     369 + 
     370 + @Override
     371 + public void onClick(View v) {
     372 + dialog.cancel();
     373 + }
     374 + });
     375 + return dialog;
     376 + }
     377 + default:
     378 + return null;
     379 + }
     380 + }
     381 + 
     382 + @Override
    351 383   public boolean onCreateOptionsMenu(Menu menu) {
    352 384   MenuInflater inflater = getMenuInflater();
    353 385   inflater.inflate(R.menu.main_menu, menu);
    skipped 27 lines
    381 413   MenuItem closeChat = menu.findItem(R.id.closeChatButton);
    382 414   closeChat.setVisible(currentPage != 0);
    383 415   
     416 + MenuItem about = menu.findItem(R.id.aboutButton);
     417 + about.setVisible(currentPage == 0);
     418 + 
    384 419   return super.onMenuOpened(featureId, menu);
    385 420   }
    386 421   
    skipped 13 lines
    400 435   viewPager.post(action);
    401 436   }
    402 437   
     438 + // @Override
     439 + // protected void onActivityResult(int requestCode, int resultCode, Intent
     440 + // data) {
     441 + // super.onActivityResult(requestCode, resultCode, data);
     442 + //
     443 + // if(DEBUG)Log.i(TAG, "Sprawdzamy extrasy...");
     444 + // if (getIntent() != null && getIntent().getExtras() != null) {
     445 + // if(DEBUG)Log.i(TAG, "Mamy extrasy");
     446 + // if (getIntent().getExtras().containsKey("chatId")) {
     447 + // long chatId = getIntent().getLongExtra("chatId", -1);
     448 + // getIntent().removeExtra("chatId");
     449 + //
     450 + // List<Chat> l = getChatList();
     451 + // for (int i = 0; i < l.size(); i++) {
     452 + // Chat chh = l.get(i);
     453 + // if (chh.getId() == chatId) {
     454 + // final int x = i + 1;
     455 + // viewSwitcher.post(new Runnable() {
     456 + //
     457 + // @Override
     458 + // public void run() {
     459 + // if(DEBUG)Log.i(TAG, "Switch chats to " + x);
     460 + //
     461 + // viewSwitcher.setCurrentItem(x);
     462 + // }
     463 + // });
     464 + //
     465 + // }
     466 + // }
     467 + // }
     468 + //
     469 + // }
     470 + // }
     471 + 
    403 472   @Override
    404 473   protected void onNewIntent(Intent intent) {
    405 474   super.onNewIntent(intent);
    skipped 5 lines
    411 480   @Override
    412 481   public boolean onOptionsItemSelected(MenuItem item) {
    413 482   switch (item.getItemId()) {
     483 + case R.id.aboutButton:
     484 + showDialog(ABOUT_DIALOG);
     485 + break;
    414 486   case R.id.showChatsButton:
    415 487   Intent chatListActivity = new Intent(this, ChatListActivity.class);
    416 488   this.startActivityForResult(chatListActivity, REQUEST_CHAT);
    skipped 43 lines
    460 532   }
    461 533   return true;
    462 534   }
    463  - 
    464  - // @Override
    465  - // protected void onActivityResult(int requestCode, int resultCode, Intent
    466  - // data) {
    467  - // super.onActivityResult(requestCode, resultCode, data);
    468  - //
    469  - // if(DEBUG)Log.i(TAG, "Sprawdzamy extrasy...");
    470  - // if (getIntent() != null && getIntent().getExtras() != null) {
    471  - // if(DEBUG)Log.i(TAG, "Mamy extrasy");
    472  - // if (getIntent().getExtras().containsKey("chatId")) {
    473  - // long chatId = getIntent().getLongExtra("chatId", -1);
    474  - // getIntent().removeExtra("chatId");
    475  - //
    476  - // List<Chat> l = getChatList();
    477  - // for (int i = 0; i < l.size(); i++) {
    478  - // Chat chh = l.get(i);
    479  - // if (chh.getId() == chatId) {
    480  - // final int x = i + 1;
    481  - // viewSwitcher.post(new Runnable() {
    482  - //
    483  - // @Override
    484  - // public void run() {
    485  - // if(DEBUG)Log.i(TAG, "Switch chats to " + x);
    486  - //
    487  - // viewSwitcher.setCurrentItem(x);
    488  - // }
    489  - // });
    490  - //
    491  - // }
    492  - // }
    493  - // }
    494  - //
    495  - // }
    496  - // }
    497 535   
    498 536   @Override
    499 537   protected void onPause() {
    skipped 93 lines
Please wait...
Page is in error, reload to recover