Exemplo n.º 1
0
        public void InitializeLayoutParadigm(View view)
        {
            primaryWebview   = view.FindViewById <ObservableWebView>(Resource.Id.primaryWebView);
            secondaryWebview = view.FindViewById <ObservableWebView>(Resource.Id.secondaryWebView);
            flipper          = view.FindViewById <ViewFlipper>(Resource.Id.view_flipper);
            text             = view.FindViewById <TextView>(Resource.Id.chapterTitle);
            gridView         = view.FindViewById <HeaderFooterGridView>(Resource.Id.chapterGridView);

            flipper.SetInAnimation(Activity, Resource.Animation.push_down_in_no_alpha);
            flipper.SetOutAnimation(Activity, Resource.Animation.push_down_out_no_alpha);

            // Style views
            Typeface face = Typeface.CreateFromAsset(Activity.Assets, "fonts/Roboto-Regular.ttf");

            text.SetTypeface(face, TypefaceStyle.Normal);

            // WebView setup
            InitializeWebView(primaryWebview);
            InitializeWebView(secondaryWebview);

            primaryWebview.Tag   = "primary";
            secondaryWebview.Tag = "secondary";

            ((LinearLayout)primaryWebview.Parent).LayoutParameters   = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.MatchParent, App.STATE.WebviewWeights[0]);
            ((LinearLayout)secondaryWebview.Parent).LayoutParameters = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.MatchParent, App.STATE.WebviewWeights[1]);

            if (App.STATE.WebviewWeights[0] == 0)
            {
                primaryWebview.IsDeflated = true;
            }
            if (App.STATE.WebviewWeights[1] == 0)
            {
                secondaryWebview.IsDeflated = true;
            }

            // GridView setup
            if (Build.VERSION.SdkInt >= BuildVersionCodes.Honeycomb)
            {
                gridView.ChoiceMode = ChoiceMode.Single;
            }

            gridView.ItemClick += SelectChapter;
        }
 public FullWidthFixedViewLayout(HeaderFooterGridView outerInstance, Context context)
     : base(context)
 {
     this.outerInstance = outerInstance;
 }