Commit cd8299b2 authored by Grigory Fedorov's avatar Grigory Fedorov

Min sdk version raised to 14. Up navigation added for most activities.

parent e589bc8d
...@@ -6,7 +6,7 @@ android { ...@@ -6,7 +6,7 @@ android {
defaultConfig { defaultConfig {
applicationId "com.xabber.androiddev" applicationId "com.xabber.androiddev"
minSdkVersion 7 minSdkVersion 14
targetSdkVersion 21 targetSdkVersion 21
} }
......
...@@ -85,19 +85,44 @@ ...@@ -85,19 +85,44 @@
<activity <activity
android:label="@string/about_viewer" android:label="@string/about_viewer"
android:name="com.xabber.android.ui.AboutViewer" android:name="com.xabber.android.ui.AboutViewer"
/> android:parentActivityName="com.xabber.android.ui.PreferenceEditor"
>
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xabber.android.ui.PreferenceEditor" />
</activity>
<activity <activity
android:label="@string/preference_accounts" android:label="@string/preference_accounts"
android:name="com.xabber.android.ui.AccountList" android:name="com.xabber.android.ui.AccountList"
/> android:parentActivityName="com.xabber.android.ui.PreferenceEditor"
>
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xabber.android.ui.PreferenceEditor" />
</activity>
<activity <activity
android:label="@string/account_editor" android:label="@string/account_editor"
android:name="com.xabber.android.ui.AccountEditor" android:name="com.xabber.android.ui.AccountEditor"
/> android:parentActivityName="com.xabber.android.ui.AccountList"
>
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xabber.android.ui.AccountList" />
</activity>
<activity <activity
android:label="@string/chat_list" android:label="@string/chat_list"
android:name="com.xabber.android.ui.ChatList" android:name="com.xabber.android.ui.ChatList"
/> android:parentActivityName="com.xabber.android.ui.ContactList"
>
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xabber.android.ui.ContactList" />
</activity>
<activity <activity
android:label="@string/occupant_list" android:label="@string/occupant_list"
android:name="com.xabber.android.ui.OccupantList" android:name="com.xabber.android.ui.OccupantList"
...@@ -107,23 +132,49 @@ ...@@ -107,23 +132,49 @@
android:name="com.xabber.android.ui.ChatViewer" android:name="com.xabber.android.ui.ChatViewer"
android:windowSoftInputMode="adjustResize" android:windowSoftInputMode="adjustResize"
android:launchMode="singleTop" android:launchMode="singleTop"
android:parentActivityName="com.xabber.android.ui.ContactList"
> >
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
</intent-filter> </intent-filter>
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xabber.android.ui.ContactList" />
</activity> </activity>
<activity <activity
android:label="@string/contact_editor" android:label="@string/contact_editor"
android:name="com.xabber.android.ui.ContactEditor" android:name="com.xabber.android.ui.ContactEditor"
/> android:parentActivityName="com.xabber.android.ui.ContactList"
>
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xabber.android.ui.ContactList" />
</activity>
<activity <activity
android:label="@string/contact_add" android:label="@string/contact_add"
android:name="com.xabber.android.ui.ContactAdd" android:name="com.xabber.android.ui.ContactAdd"
/> android:parentActivityName="com.xabber.android.ui.AccountList"
>
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xabber.android.ui.AccountList" />
</activity>
<activity <activity
android:label="@string/account_add" android:label="@string/account_add"
android:name="com.xabber.android.ui.AccountAdd" android:name="com.xabber.android.ui.AccountAdd"
/> android:parentActivityName="com.xabber.android.ui.AccountList"
>
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xabber.android.ui.AccountList" />
</activity>
<activity <activity
android:label="@string/account_oauth" android:label="@string/account_oauth"
android:name="com.xabber.android.ui.OAuthActivity" android:name="com.xabber.android.ui.OAuthActivity"
...@@ -131,24 +182,58 @@ ...@@ -131,24 +182,58 @@
<activity <activity
android:label="@string/muc_add" android:label="@string/muc_add"
android:name="com.xabber.android.ui.MUCEditor" android:name="com.xabber.android.ui.MUCEditor"
/> android:parentActivityName="com.xabber.android.ui.ContactList"
>
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xabber.android.ui.ContactList" />
</activity>
<activity <activity
android:label="@string/status_editor" android:label="@string/status_editor"
android:name="com.xabber.android.ui.StatusEditor" android:name="com.xabber.android.ui.StatusEditor"
/> android:parentActivityName="com.xabber.android.ui.ContactList"
>
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xabber.android.ui.ContactList" />
</activity>
<activity <activity
android:label="@string/preference_editor" android:label="@string/preference_editor"
android:name="com.xabber.android.ui.PreferenceEditor" android:name="com.xabber.android.ui.PreferenceEditor"
/> android:parentActivityName="com.xabber.android.ui.ContactList"
>
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xabber.android.ui.ContactList" />
</activity>
<activity <activity
android:label="@string/chat_settings" android:label="@string/chat_settings"
android:name="com.xabber.android.ui.ChatEditor" android:name="com.xabber.android.ui.ChatEditor"
/> android:parentActivityName="com.xabber.android.ui.ChatViewer"
>
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xabber.android.ui.ChatViewer" />
</activity>
<activity <activity
android:label="@string/contact_viewer" android:label="@string/contact_viewer"
android:name="com.xabber.android.ui.ContactViewer" android:name="com.xabber.android.ui.ContactViewer"
android:icon="@drawable/ic_information" android:icon="@drawable/ic_information"
android:parentActivityName="com.xabber.android.ui.ContactList"
> >
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xabber.android.ui.ContactList" />
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
...@@ -160,11 +245,24 @@ ...@@ -160,11 +245,24 @@
<activity <activity
android:name="com.xabber.android.ui.FingerprintViewer" android:name="com.xabber.android.ui.FingerprintViewer"
android:label="@string/otr_verify_fingerprint" android:label="@string/otr_verify_fingerprint"
/> android:parentActivityName="com.xabber.android.ui.ChatViewer"
>
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xabber.android.ui.ChatViewer" />
</activity>
<activity <activity
android:name="com.xabber.android.ui.QuestionViewer" android:name="com.xabber.android.ui.QuestionViewer"
android:label="@string/otr_verify_fingerprint" android:label="@string/otr_verify_fingerprint"
/> android:parentActivityName="com.xabber.android.ui.ChatViewer"
>
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xabber.android.ui.ChatViewer" />
</activity>
<activity <activity
android:name="com.xabber.android.ui.ContactSubscription" android:name="com.xabber.android.ui.ContactSubscription"
...@@ -200,6 +298,8 @@ ...@@ -200,6 +298,8 @@
android:stateNotNeeded="true" android:stateNotNeeded="true"
android:excludeFromRecents="true" android:excludeFromRecents="true"
/> />
<service android:name="com.xabber.android.service.XabberService" /> <service android:name="com.xabber.android.service.XabberService" />
<service <service
android:name="com.xabber.android.service.SyncAdapterService" android:name="com.xabber.android.service.SyncAdapterService"
......
...@@ -17,7 +17,9 @@ package com.xabber.android.ui; ...@@ -17,7 +17,9 @@ package com.xabber.android.ui;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.text.method.LinkMovementMethod; import android.text.method.LinkMovementMethod;
import android.view.MenuItem;
import android.widget.TextView; import android.widget.TextView;
import com.xabber.android.ui.helper.ManagedActivity; import com.xabber.android.ui.helper.ManagedActivity;
...@@ -34,10 +36,23 @@ public class AboutViewer extends ManagedActivity { ...@@ -34,10 +36,23 @@ public class AboutViewer extends ManagedActivity {
getString(R.string.application_version))); getString(R.string.application_version)));
((TextView) findViewById(R.id.about_license)) ((TextView) findViewById(R.id.about_license))
.setMovementMethod(LinkMovementMethod.getInstance()); .setMovementMethod(LinkMovementMethod.getInstance());
getActionBar().setDisplayHomeAsUpEnabled(true);
} }
public static Intent createIntent(Context context) { public static Intent createIntent(Context context) {
return new Intent(context, AboutViewer.class); return new Intent(context, AboutViewer.class);
} }
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
// Respond to the action bar's Up/Home button
case android.R.id.home:
NavUtils.navigateUpFromSameTask(this);
return true;
}
return super.onOptionsItemSelected(item);
}
} }
...@@ -83,6 +83,8 @@ public class AccountAdd extends ManagedActivity implements ...@@ -83,6 +83,8 @@ public class AccountAdd extends ManagedActivity implements
InputMethodManager inputManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager inputManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.hideSoftInputFromWindow(findViewById(R.id.ok) inputManager.hideSoftInputFromWindow(findViewById(R.id.ok)
.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); .getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
getActionBar().setDisplayHomeAsUpEnabled(true);
} }
@Override @Override
......
...@@ -50,6 +50,12 @@ public class AccountEditor extends BaseSettingsActivity implements ...@@ -50,6 +50,12 @@ public class AccountEditor extends BaseSettingsActivity implements
private Preference oauthPreference; private Preference oauthPreference;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override @Override
protected void onInflate(Bundle savedInstanceState) { protected void onInflate(Bundle savedInstanceState) {
account = AccountEditor.getAccount(getIntent()); account = AccountEditor.getAccount(getIntent());
......
...@@ -37,6 +37,12 @@ public class AccountList extends BaseListEditor<String> implements ...@@ -37,6 +37,12 @@ public class AccountList extends BaseListEditor<String> implements
private static final int CONTEXT_MENU_VIEW_ACCOUNT_ID = 0x20; private static final int CONTEXT_MENU_VIEW_ACCOUNT_ID = 0x20;
private static final int CONTEXT_MENU_STATUS_EDITOR_ID = 0x30; private static final int CONTEXT_MENU_STATUS_EDITOR_ID = 0x30;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override @Override
protected int getAddTextResourceId() { protected int getAddTextResourceId() {
return R.string.account_add; return R.string.account_add;
......
...@@ -35,6 +35,13 @@ public class ChatEditor extends BaseSettingsActivity { ...@@ -35,6 +35,13 @@ public class ChatEditor extends BaseSettingsActivity {
private String account; private String account;
private String user; private String user;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override @Override
protected void onInflate(Bundle savedInstanceState) { protected void onInflate(Bundle savedInstanceState) {
account = getAccount(getIntent()); account = getAccount(getIntent());
......
...@@ -49,6 +49,8 @@ public class ChatList extends ManagedListActivity implements ...@@ -49,6 +49,8 @@ public class ChatList extends ManagedListActivity implements
listAdapter = new ChatListAdapter(this); listAdapter = new ChatListAdapter(this);
setListAdapter(listAdapter); setListAdapter(listAdapter);
getListView().setOnItemClickListener(this); getListView().setOnItemClickListener(this);
getActionBar().setDisplayHomeAsUpEnabled(true);
} }
@Override @Override
......
...@@ -19,8 +19,10 @@ import java.util.Collection; ...@@ -19,8 +19,10 @@ import java.util.Collection;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem;
import android.view.View; import android.view.View;
import com.xabber.android.data.ActivityManager; import com.xabber.android.data.ActivityManager;
...@@ -113,6 +115,8 @@ public class ChatViewer extends ManagedActivity implements OnSelectListener, ...@@ -113,6 +115,8 @@ public class ChatViewer extends ManagedActivity implements OnSelectListener,
if (actionWithUser == null) if (actionWithUser == null)
actionWithUser = user; actionWithUser = user;
getActionBar().setDisplayHomeAsUpEnabled(true);
selectChat(actionWithAccount, actionWithUser); selectChat(actionWithAccount, actionWithUser);
} }
...@@ -392,4 +396,15 @@ public class ChatViewer extends ManagedActivity implements OnSelectListener, ...@@ -392,4 +396,15 @@ public class ChatViewer extends ManagedActivity implements OnSelectListener,
return ACTION_ATTENTION.equals(intent.getAction()); return ACTION_ATTENTION.equals(intent.getAction());
} }
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
// Respond to the action bar's Up/Home button
case android.R.id.home:
NavUtils.navigateUpFromSameTask(this);
return true;
}
return super.onOptionsItemSelected(item);
}
} }
...@@ -58,6 +58,13 @@ public class ContactAdd extends GroupListActivity implements ...@@ -58,6 +58,13 @@ public class ContactAdd extends GroupListActivity implements
private EditText userView; private EditText userView;
private EditText nameView; private EditText nameView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override @Override
protected void onInflate(Bundle savedInstanceState) { protected void onInflate(Bundle savedInstanceState) {
setContentView(R.layout.contact_add); setContentView(R.layout.contact_add);
......
...@@ -43,6 +43,13 @@ public class ContactEditor extends GroupListActivity implements ...@@ -43,6 +43,13 @@ public class ContactEditor extends GroupListActivity implements
private String account; private String account;
private String user; private String user;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override @Override
protected void onInflate(Bundle savedInstanceState) { protected void onInflate(Bundle savedInstanceState) {
setContentView(R.layout.contact_editor); setContentView(R.layout.contact_editor);
......
...@@ -203,6 +203,8 @@ public class ContactViewer extends ManagedPreferenceActivity implements ...@@ -203,6 +203,8 @@ public class ContactViewer extends ManagedPreferenceActivity implements
} }
} }
setTitle(getString(R.string.contact_viewer_for, bareAddress)); setTitle(getString(R.string.contact_viewer_for, bareAddress));
getActionBar().setDisplayHomeAsUpEnabled(true);
} }
@Override @Override
......
...@@ -119,6 +119,8 @@ public class FingerprintViewer extends ManagedActivity implements ...@@ -119,6 +119,8 @@ public class FingerprintViewer extends ManagedActivity implements
copyView = findViewById(R.id.copy); copyView = findViewById(R.id.copy);
copyView.setOnClickListener(this); copyView.setOnClickListener(this);
isUpdating = false; isUpdating = false;
getActionBar().setDisplayHomeAsUpEnabled(true);
} }
@Override @Override
......
...@@ -72,6 +72,8 @@ public class MUCEditor extends ManagedActivity implements View.OnClickListener, ...@@ -72,6 +72,8 @@ public class MUCEditor extends ManagedActivity implements View.OnClickListener,
setContentView(R.layout.muc_editor); setContentView(R.layout.muc_editor);
getActionBar().setDisplayHomeAsUpEnabled(true);
accountView = (Spinner) findViewById(R.id.contact_account); accountView = (Spinner) findViewById(R.id.contact_account);
serverView = (EditText) findViewById(R.id.muc_server); serverView = (EditText) findViewById(R.id.muc_server);
roomView = (EditText) findViewById(R.id.muc_room); roomView = (EditText) findViewById(R.id.muc_room);
......
...@@ -53,6 +53,8 @@ public class PreferenceEditor extends ManagedPreferenceActivity implements ...@@ -53,6 +53,8 @@ public class PreferenceEditor extends ManagedPreferenceActivity implements
if (isFinishing()) if (isFinishing())
return; return;
getActionBar().setDisplayHomeAsUpEnabled(true);
addPreferencesFromResource(R.xml.preference_editor); addPreferencesFromResource(R.xml.preference_editor);
getPreferenceScreen().findPreference( getPreferenceScreen().findPreference(
......
...@@ -98,6 +98,8 @@ public class QuestionViewer extends ManagedActivity implements ...@@ -98,6 +98,8 @@ public class QuestionViewer extends ManagedActivity implements
setContentView(R.layout.secret_viewer); setContentView(R.layout.secret_viewer);
findViewById(R.id.cancel).setOnClickListener(this); findViewById(R.id.cancel).setOnClickListener(this);
findViewById(R.id.send).setOnClickListener(this); findViewById(R.id.send).setOnClickListener(this);
getActionBar().setDisplayHomeAsUpEnabled(true);
} }
@Override @Override
......
...@@ -72,6 +72,8 @@ public class StatusEditor extends ManagedListActivity implements ...@@ -72,6 +72,8 @@ public class StatusEditor extends ManagedListActivity implements
setContentView(R.layout.status_editor); setContentView(R.layout.status_editor);
getActionBar().setDisplayHomeAsUpEnabled(true);
Intent intent = getIntent(); Intent intent = getIntent();
account = StatusEditor.getAccount(intent); account = StatusEditor.getAccount(intent);
if (account == null) if (account == null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment