Skip to content
This repository has been archived by the owner on Jan 30, 2021. It is now read-only.

TintContextWrapper Issue Resolved #74 #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
compileSdkVersion 24
buildToolsVersion "24.0.0"

defaultConfig {
// applicationId "com.oguzdev.circularfloatingactionmenu.library"
minSdkVersion 15
targetSdkVersion 21
targetSdkVersion 24
versionCode 3
versionName "1.0.2"
}
Expand All @@ -26,6 +26,8 @@ repositories {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
}

// apply from: '../gradle-mvn-push.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import android.graphics.Rect;
import android.graphics.RectF;
import android.hardware.SensorManager;
import android.support.v7.widget.TintContextWrapper;
import android.view.Display;
import android.view.Gravity;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -392,9 +393,12 @@ public List<Item> getSubActionItems() {
*/
public View getActivityContentView() {
try {
return ((Activity) mainActionView.getContext()).getWindow().getDecorView().findViewById(android.R.id.content);
}
catch(ClassCastException e) {
if (mainActionView.getContext() instanceof TintContextWrapper) {
return ((Activity) ((TintContextWrapper) mainActionView.getContext()).getBaseContext()).getWindow().getDecorView().findViewById(android.R.id.content);
} else {
return ((Activity) mainActionView.getContext()).getWindow().getDecorView().findViewById(android.R.id.content);
}
} catch (ClassCastException e) {
throw new ClassCastException("Please provide an Activity context for this FloatingActionMenu.");
}
}
Expand Down
6 changes: 3 additions & 3 deletions samples/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
compileSdkVersion 24
buildToolsVersion "24.0.0"

defaultConfig {
applicationId "com.oguzdev.circularfloatingactionmenu.samples"
minSdkVersion 15
targetSdkVersion 21
targetSdkVersion 24
versionCode 3
versionName "1.0.2"
}
Expand Down