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 {
defaultConfig {
applicationId "com.xabber.androiddev"
minSdkVersion 7
minSdkVersion 14
targetSdkVersion 21
}
......
......@@ -85,19 +85,44 @@
<activity
android:label="@string/about_viewer"
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
android:label="@string/preference_accounts"
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
android:label="@string/account_editor"
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
android:label="@string/chat_list"
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
android:label="@string/occupant_list"
android:name="com.xabber.android.ui.OccupantList"
......@@ -107,23 +132,49 @@
android:name="com.xabber.android.ui.ChatViewer"
android:windowSoftInputMode="adjustResize"
android:launchMode="singleTop"
android:parentActivityName="com.xabber.android.ui.ContactList"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</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
android:label="@string/contact_editor"
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
android:label="@string/contact_add"
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
android:label="@string/account_add"
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
android:label="@string/account_oauth"
android:name="com.xabber.android.ui.OAuthActivity"
......@@ -131,24 +182,58 @@
<activity
android:label="@string/muc_add"
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
android:label="@string/status_editor"
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
android:label="@string/preference_editor"
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
android:label="@string/chat_settings"
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
android:label="@string/contact_viewer"
android:name="com.xabber.android.ui.ContactViewer"
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>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
......@@ -160,11 +245,24 @@
<activity
android:name="com.xabber.android.ui.FingerprintViewer"
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
android:name="com.xabber.android.ui.QuestionViewer"
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
android:name="com.xabber.android.ui.ContactSubscription"
......@@ -200,6 +298,8 @@
android:stateNotNeeded="true"
android:excludeFromRecents="true"
/>
<service android:name="com.xabber.android.service.XabberService" />
<service
android:name="com.xabber.android.service.SyncAdapterService"
......
......@@ -17,7 +17,9 @@ package com.xabber.android.ui;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.text.method.LinkMovementMethod;
import android.view.MenuItem;
import android.widget.TextView;
import com.xabber.android.ui.helper.ManagedActivity;
......@@ -34,10 +36,23 @@ public class AboutViewer extends ManagedActivity {
getString(R.string.application_version)));
((TextView) findViewById(R.id.about_license))
.setMovementMethod(LinkMovementMethod.getInstance());
getActionBar().setDisplayHomeAsUpEnabled(true);
}
public static Intent createIntent(Context context) {
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
InputMethodManager inputManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.hideSoftInputFromWindow(findViewById(R.id.ok)
.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
......
......@@ -50,7 +50,13 @@ public class AccountEditor extends BaseSettingsActivity implements
private Preference oauthPreference;
@Override
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
protected void onInflate(Bundle savedInstanceState) {
account = AccountEditor.getAccount(getIntent());
if (account == null) {
......
......@@ -37,7 +37,13 @@ public class AccountList extends BaseListEditor<String> implements
private static final int CONTEXT_MENU_VIEW_ACCOUNT_ID = 0x20;
private static final int CONTEXT_MENU_STATUS_EDITOR_ID = 0x30;
@Override
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
protected int getAddTextResourceId() {
return R.string.account_add;
}
......
......@@ -35,7 +35,14 @@ public class ChatEditor extends BaseSettingsActivity {
private String account;
private String user;
@Override
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
protected void onInflate(Bundle savedInstanceState) {
account = getAccount(getIntent());
user = getUser(getIntent());
......
......@@ -49,6 +49,8 @@ public class ChatList extends ManagedListActivity implements
listAdapter = new ChatListAdapter(this);
setListAdapter(listAdapter);
getListView().setOnItemClickListener(this);
getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
......
......@@ -19,8 +19,10 @@ import java.util.Collection;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import com.xabber.android.data.ActivityManager;
......@@ -113,6 +115,8 @@ public class ChatViewer extends ManagedActivity implements OnSelectListener,
if (actionWithUser == null)
actionWithUser = user;
getActionBar().setDisplayHomeAsUpEnabled(true);
selectChat(actionWithAccount, actionWithUser);
}
......@@ -392,4 +396,15 @@ public class ChatViewer extends ManagedActivity implements OnSelectListener,
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,7 +58,14 @@ public class ContactAdd extends GroupListActivity implements
private EditText userView;
private EditText nameView;
@Override
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
protected void onInflate(Bundle savedInstanceState) {
setContentView(R.layout.contact_add);
......
......@@ -43,7 +43,14 @@ public class ContactEditor extends GroupListActivity implements
private String account;
private String user;
@Override
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
protected void onInflate(Bundle savedInstanceState) {
setContentView(R.layout.contact_editor);
......
......@@ -203,6 +203,8 @@ public class ContactViewer extends ManagedPreferenceActivity implements
}
}
setTitle(getString(R.string.contact_viewer_for, bareAddress));
getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
......
......@@ -119,6 +119,8 @@ public class FingerprintViewer extends ManagedActivity implements
copyView = findViewById(R.id.copy);
copyView.setOnClickListener(this);
isUpdating = false;
getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
......
......@@ -72,6 +72,8 @@ public class MUCEditor extends ManagedActivity implements View.OnClickListener,
setContentView(R.layout.muc_editor);
getActionBar().setDisplayHomeAsUpEnabled(true);
accountView = (Spinner) findViewById(R.id.contact_account);
serverView = (EditText) findViewById(R.id.muc_server);
roomView = (EditText) findViewById(R.id.muc_room);
......
......@@ -53,6 +53,8 @@ public class PreferenceEditor extends ManagedPreferenceActivity implements
if (isFinishing())
return;
getActionBar().setDisplayHomeAsUpEnabled(true);
addPreferencesFromResource(R.xml.preference_editor);
getPreferenceScreen().findPreference(
......
......@@ -98,6 +98,8 @@ public class QuestionViewer extends ManagedActivity implements
setContentView(R.layout.secret_viewer);
findViewById(R.id.cancel).setOnClickListener(this);
findViewById(R.id.send).setOnClickListener(this);
getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
......
......@@ -72,6 +72,8 @@ public class StatusEditor extends ManagedListActivity implements
setContentView(R.layout.status_editor);
getActionBar().setDisplayHomeAsUpEnabled(true);
Intent intent = getIntent();
account = StatusEditor.getAccount(intent);
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