Android: upgrade to AppCompat 22.1

This commit is contained in:
jendib 2015-04-22 23:18:14 +02:00
parent 1c4161981b
commit b8061a6a1e
7 changed files with 27 additions and 20 deletions

View File

@ -101,15 +101,15 @@
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="fab-0.0.6" level="project" />
<orderEntry type="library" exported="" name="support-v4-22.0.0" level="project" />
<orderEntry type="library" exported="" name="android-easing-1.0.3" level="project" />
<orderEntry type="library" exported="" name="imagezoom-1.0.5" level="project" />
<orderEntry type="library" exported="" name="support-annotations-22.0.0" level="project" />
<orderEntry type="library" exported="" name="eventbus-2.4.0" level="project" />
<orderEntry type="library" exported="" name="android-query.0.26.8" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-22.0.0" level="project" />
<orderEntry type="library" exported="" name="tokenautocomplete-1.2.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-22.1.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-22.1.0" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-22.0.0" level="project" />
<orderEntry type="library" exported="" name="android-async-http-1.4.6" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-22.1.0" level="project" />
</component>
</module>

View File

@ -35,7 +35,7 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:appcompat-v7:22.1.0'
compile 'com.android.support:recyclerview-v7:22.0.0'
compile 'com.loopj.android:android-async-http:1.4.6'
compile 'it.sephiroth.android.library.imagezoom:imagezoom:1.0.5'

View File

@ -3,7 +3,7 @@ package com.sismics.docs.activity;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
@ -43,7 +43,7 @@ import de.greenrobot.event.EventBus;
*
* @author bgamard.
*/
public class DocumentEditActivity extends ActionBarActivity {
public class DocumentEditActivity extends AppCompatActivity {
/**
* Document edited.
*/

View File

@ -13,7 +13,7 @@ import android.os.Bundle;
import android.os.Environment;
import android.support.v4.app.DialogFragment;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.text.format.DateFormat;
@ -57,7 +57,7 @@ import de.greenrobot.event.EventBus;
*
* @author bgamard
*/
public class DocumentViewActivity extends ActionBarActivity {
public class DocumentViewActivity extends AppCompatActivity {
/**
* Request code of adding file.
*/
@ -116,8 +116,10 @@ public class DocumentViewActivity extends ActionBarActivity {
// Setup the activity
setContentView(R.layout.document_view_activity);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
}
// Fill the view
refreshDocument(document);

View File

@ -3,7 +3,7 @@ package com.sismics.docs.activity;
import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.View;
@ -30,7 +30,7 @@ import org.json.JSONObject;
*
* @author bgamard
*/
public class LoginActivity extends ActionBarActivity {
public class LoginActivity extends AppCompatActivity {
/**
* User interface.

View File

@ -7,8 +7,8 @@ import android.content.res.Configuration;
import android.os.Bundle;
import android.provider.SearchRecentSuggestions;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SearchView;
import android.view.Menu;
import android.view.MenuInflater;
@ -39,7 +39,8 @@ import de.greenrobot.event.EventBus;
*
* @author bgamard
*/
public class MainActivity extends ActionBarActivity {
public class MainActivity extends AppCompatActivity {
private ActionBarDrawerToggle drawerToggle;
private MenuItem searchItem;
@ -61,8 +62,10 @@ public class MainActivity extends ActionBarActivity {
// Enable ActionBar app icon to behave as action to toggle nav drawer
drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
}
// ActionBarDrawerToggle ties together the the proper interactions
// between the sliding drawer and the action bar app icon

View File

@ -1,7 +1,7 @@
package com.sismics.docs.activity;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import com.sismics.docs.fragment.SettingsFragment;
@ -11,14 +11,16 @@ import com.sismics.docs.fragment.SettingsFragment;
*
* @author bgamard.
*/
public class SettingsActivity extends ActionBarActivity {
public class SettingsActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
}
// Display the fragment as the main content.
getFragmentManager().beginTransaction()