diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 5749a06..f8e2f04 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -11,7 +11,7 @@ + android:theme="@style/AppTheme.NoActionBar"> diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml index dbbdd40..a99ae91 100644 --- a/app/src/main/res/values-v21/styles.xml +++ b/app/src/main/res/values-v21/styles.xml @@ -1,9 +1,9 @@ - diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 1bd8d96..71cb9b1 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -6,11 +6,9 @@ @color/colorPrimary @color/colorPrimaryDark @color/colorAccent - false - true - diff --git a/arcnavigationview/src/main/java/com/rom4ek/arcnavigationview/ArcNavigationView.java b/arcnavigationview/src/main/java/com/rom4ek/arcnavigationview/ArcNavigationView.java index 50228d9..5fdda77 100644 --- a/arcnavigationview/src/main/java/com/rom4ek/arcnavigationview/ArcNavigationView.java +++ b/arcnavigationview/src/main/java/com/rom4ek/arcnavigationview/ArcNavigationView.java @@ -8,9 +8,11 @@ import android.graphics.Path; import android.graphics.PathMeasure; import android.graphics.Rect; +import android.graphics.drawable.ColorDrawable; import android.os.Build; import android.support.annotation.RequiresApi; import android.support.design.internal.NavigationMenuView; +import android.support.design.internal.ScrimInsetsFrameLayout; import android.support.design.widget.NavigationView; import android.support.v4.view.ViewCompat; import android.support.v4.widget.DrawerLayout; @@ -22,6 +24,8 @@ import android.view.ViewOutlineProvider; import android.widget.TextView; +import java.lang.reflect.Field; + /** * Created by rom4ek on 10.01.2017. */ @@ -62,9 +66,23 @@ public void init(Context context, AttributeSet attrs) { setLayerType(View.LAYER_TYPE_SOFTWARE, null); } setBackgroundColor(Color.TRANSPARENT); + setInsetsColor(Color.TRANSPARENT); THRESHOLD = Math.round(ArcViewSettings.dpToPx(getContext(), 15)); //some threshold for child views while remeasuring them } + private void setInsetsColor(int color) { + try { + Field insetForegroundField = ScrimInsetsFrameLayout.class.getDeclaredField("mInsetForeground"); + insetForegroundField.setAccessible(true); + ColorDrawable colorDrawable = new ColorDrawable(color); + insetForegroundField.set(this, colorDrawable); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + @SuppressLint("RtlHardcoded") private Path createClipPath() { final Path path = new Path(); @@ -251,7 +269,7 @@ private Rect locateView(View view) { protected void dispatchDraw(Canvas canvas) { canvas.save(); - canvas.clipPath(clipPath); + canvas.clipPath(clipPath);; super.dispatchDraw(canvas); canvas.restore(); diff --git a/build.gradle b/build.gradle index 083fe93..46363f7 100644 --- a/build.gradle +++ b/build.gradle @@ -23,6 +23,6 @@ ext { sdk = 25 buildTools = "25.0.2" minSdk = 14 - libraryVersion = "1.0.2" + libraryVersion = "1.0.3" supportVersion = "25.3.0" }