This repository has been archived by the owner on Apr 24, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #311 from amlcurran/fix-clipping-appcomapt
Fixes for appcompat
- Loading branch information
Showing
13 changed files
with
172 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
sample/src/main/java/com/github/amlcurran/showcaseview/sample/ActionItemsSampleActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.github.amlcurran.showcaseview.sample; | ||
|
||
import android.os.Bundle; | ||
import android.support.annotation.Nullable; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.support.v7.widget.Toolbar; | ||
import android.view.Menu; | ||
|
||
import com.github.amlcurran.showcaseview.ShowcaseView; | ||
|
||
public class ActionItemsSampleActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_action_items); | ||
Toolbar viewById = (Toolbar) findViewById(R.id.toolbar); | ||
setSupportActionBar(viewById); | ||
|
||
new ShowcaseView.Builder(this) | ||
.withMaterialShowcase() | ||
.setTarget(new ToolbarActionItemTarget(viewById, R.id.menu_item1)) | ||
.setStyle(R.style.CustomShowcaseTheme2) | ||
.setContentText("Here's how to highlight items on a toolbar") | ||
.build() | ||
.show(); | ||
} | ||
|
||
@Override | ||
public boolean onCreateOptionsMenu(Menu menu) { | ||
getMenuInflater().inflate(R.menu.menu, menu); | ||
return super.onCreateOptionsMenu(menu); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
sample/src/main/java/com/github/amlcurran/showcaseview/sample/ToolbarActionItemTarget.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright 2014 Alex Curran | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.github.amlcurran.showcaseview.sample; | ||
|
||
import android.graphics.Point; | ||
import android.support.annotation.IdRes; | ||
import android.support.v7.widget.Toolbar; | ||
|
||
import com.github.amlcurran.showcaseview.targets.Target; | ||
import com.github.amlcurran.showcaseview.targets.ViewTarget; | ||
|
||
/** | ||
* Represents an Action item to showcase (e.g., one of the buttons on an ActionBar). | ||
* To showcase specific action views such as the home button, use {@link ToolbarActionItemTarget} | ||
* | ||
* @see ToolbarActionItemTarget | ||
*/ | ||
public class ToolbarActionItemTarget implements Target { | ||
|
||
private final Toolbar toolbar; | ||
private final int menuItemId; | ||
|
||
public ToolbarActionItemTarget(Toolbar toolbar, @IdRes int itemId) { | ||
this.toolbar = toolbar; | ||
this.menuItemId = itemId; | ||
} | ||
|
||
@Override | ||
public Point getPoint() { | ||
return new ViewTarget(toolbar.findViewById(menuItemId)).getPoint(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!-- | ||
~ Copyright 2014 Alex Curran | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
|
||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:orientation="vertical"> | ||
|
||
<android.support.v7.widget.Toolbar | ||
android:layout_width="match_parent" | ||
android:id="@+id/toolbar" | ||
app:theme="@style/Toolbar" | ||
android:layout_height="wrap_content"/> | ||
|
||
<Button | ||
android:id="@+id/buttonBlocked" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Button" | ||
android:minWidth="96dp" | ||
android:layout_margin="16dp" | ||
android:layout_gravity="center" /> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters