Example #1
0
 protected virtual void onApplyThemeResource(android.content.res.Resources.Theme arg0, int arg1, bool arg2)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         @__env.CallVoidMethod(this.JvmHandle, global::android.view.ContextThemeWrapper._onApplyThemeResource8713, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2));
     }
     else
     {
         @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.view.ContextThemeWrapper.staticClass, global::android.view.ContextThemeWrapper._onApplyThemeResource8713, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2));
     }
 }
Example #2
0
        private void initializeTheme()
        {
            bool first = mTheme == null;

            if (first)
            {
                mTheme = getResources().newTheme();
                android.content.res.Resources.Theme theme = mBase.getTheme();
                if (theme != null)
                {
                    mTheme.setTo(theme);
                }
            }
            onApplyThemeResource(mTheme, mThemeResource, first);
        }
Example #3
0
 public override android.content.Context getThemedContext()
 {
     if (mThemedContext == null)
     {
         android.util.TypedValue             outValue     = new android.util.TypedValue();
         android.content.res.Resources.Theme currentTheme = mContext.getTheme();
         currentTheme.resolveAttribute([email protected], outValue
                                       , true);
         int targetThemeRes = outValue.resourceId;
         if (targetThemeRes != 0 && mContext.getThemeResId() != targetThemeRes)
         {
             mThemedContext = new android.view.ContextThemeWrapper(mContext, targetThemeRes);
         }
         else
         {
             mThemedContext = mContext;
         }
     }
     return(mThemedContext);
 }
Example #4
0
 /// <summary>
 /// Called by
 /// <see cref="setTheme(int)">setTheme(int)</see>
 /// and
 /// <see cref="getTheme()">getTheme()</see>
 /// to apply a theme
 /// resource to the current Theme object.  Can override to change the
 /// default (simple) behavior.  This method will not be called in multiple
 /// threads simultaneously.
 /// </summary>
 /// <param name="theme">The Theme object being modified.</param>
 /// <param name="resid">The theme style resource being applied to <var>theme</var>.</param>
 /// <param name="first">
 /// Set to true if this is the first time a style is being
 /// applied to <var>theme</var>.
 /// </param>
 protected internal virtual void onApplyThemeResource(android.content.res.Resources
                                                      .Theme theme, int resid, bool first)
 {
     theme.applyStyle(resid, true);
 }
Example #5
0
		public override android.content.res.Resources.Theme getTheme()
		{
			if (mTheme == null)
			{
				mThemeResource = android.content.res.Resources.selectDefaultTheme(mThemeResource, 
					getOuterContext().getApplicationInfo().targetSdkVersion);
				mTheme = mResources.newTheme();
				mTheme.applyStyle(mThemeResource, true);
			}
			return mTheme;
		}