Skip to content

Commit

Permalink
Update MaterialMenuIconCompat to use AppCompatActivity
Browse files Browse the repository at this point in the history
  • Loading branch information
balysv committed May 30, 2015
1 parent c0c9199 commit eb7cc24
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.balysv.materialmenu.demo.abc_v21;

import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;

import com.balysv.materialmenu.demo.BaseActivityHelper;
import com.balysv.materialmenu.demo.R;

public abstract class BaseActivity extends ActionBarActivity {
public abstract class BaseActivity extends AppCompatActivity {

protected BaseActivityHelper helper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;

Expand All @@ -15,7 +15,7 @@
import static com.balysv.materialmenu.demo.BaseActivityHelper.intToState;


public class ToolbarActivity extends ActionBarActivity {
public class ToolbarActivity extends AppCompatActivity {

private MaterialMenuIconToolbar materialMenu;

Expand Down
18 changes: 18 additions & 0 deletions demo/src/toolbar/res/layout/toolbar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,24 @@
android:text="@string/set_check"/>


<Button
android:id="@+id/switch_item_show"
android:textColor="@android:color/white"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:padding="4dp"
android:text="@string/set_show"/>

<Button
android:id="@+id/switch_item_hide"
android:textColor="@android:color/white"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:padding="4dp"
android:text="@string/set_hide"/>

</LinearLayout>
</RelativeLayout>
</LinearLayout>
Expand Down
2 changes: 1 addition & 1 deletion demo/src/toolbar/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources>

<style name="AppTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="colorPrimary">#575757</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

import android.app.Activity;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.balysv.materialmenu.MaterialMenuBase;
import com.balysv.materialmenu.MaterialMenuDrawable;

public class MaterialMenuIconCompat extends MaterialMenuBase {

public MaterialMenuIconCompat(ActionBarActivity activity, int color, MaterialMenuDrawable.Stroke stroke) {
public MaterialMenuIconCompat(AppCompatActivity activity, int color, MaterialMenuDrawable.Stroke stroke) {
super(activity, color, stroke);
}

public MaterialMenuIconCompat(ActionBarActivity activity, int color, MaterialMenuDrawable.Stroke stroke, int transformDuration) {
public MaterialMenuIconCompat(AppCompatActivity activity, int color, MaterialMenuDrawable.Stroke stroke, int transformDuration) {
super(activity, color, stroke, transformDuration);
}

Expand All @@ -35,7 +35,7 @@ protected boolean providesActionBar() {

@Override
protected void setActionBarSettings(Activity activity) {
ActionBar actionBar = ((ActionBarActivity) activity).getSupportActionBar();
ActionBar actionBar = ((AppCompatActivity) activity).getSupportActionBar();
actionBar.setDisplayShowHomeEnabled(true);
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setHomeButtonEnabled(true);
Expand Down

0 comments on commit eb7cc24

Please sign in to comment.