Ejemplo n.º 1
0
        private void InitComponent(View view)
        {
            try
            {
                CollapsingToolbar       = view.FindViewById <CollapsingToolbarLayout>(Resource.Id.collapsingToolbar);
                CollapsingToolbar.Title = " ";

                AppBarLayout = view.FindViewById <AppBarLayout>(Resource.Id.mainAppBarLayout);
                AppBarLayout.SetExpanded(true);

                MRecycler        = view.FindViewById <RecyclerView>(Resource.Id.albums_recyler);
                EmptyStateLayout = view.FindViewById <ViewStub>(Resource.Id.viewStub);

                ImageCover          = view.FindViewById <ImageView>(Resource.Id.imageCover);
                ImageAvatar         = view.FindViewById <ImageView>(Resource.Id.imageAvatar);
                AlbumName           = view.FindViewById <TextView>(Resource.Id.albumName);
                CountSoungAlbumText = view.FindViewById <TextView>(Resource.Id.CountSoungAlbumText);
                NameUserText        = view.FindViewById <TextView>(Resource.Id.nameUserText);
                BackIcon            = view.FindViewById <ImageView>(Resource.Id.back);
                BackIcon.Click     += BackIcon_Click;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Ejemplo n.º 2
0
        public TermsAndPrivacyRenderer(Context context) : base(context)
        {
            mainActivity = (MainActivity)Context;

            _androidCoordinatorLayout = (CoordinatorLayout)mainActivity.LayoutInflater.Inflate(Resource.Layout.TermsAndPrivacy, null);

            _androidAppBarLayout = _androidCoordinatorLayout.FindViewById <AppBarLayout>(Resource.Id.termsAppBar);

            toolbar = _androidAppBarLayout.FindViewById <Toolbar>(Resource.Id.termsToolBar);

            mainActivity?.SetSupportActionBar(toolbar);
            ActionBar actionBar = mainActivity?.SupportActionBar;

            if (actionBar != null)
            {
                actionBar.SetDisplayHomeAsUpEnabled(true);
                actionBar.SetDisplayShowHomeEnabled(true);
                actionBar.SetDisplayShowTitleEnabled(false);
            }

            viewPager = _androidCoordinatorLayout.FindViewById <ViewPager>(Resource.Id.pager);

            tabLayout = _androidAppBarLayout.FindViewById <TabLayout>(Resource.Id.tabLayout1);
            tabLayout.SetupWithViewPager(viewPager);
        }
Ejemplo n.º 3
0
        private void InitToolbar()
        {
            Toolbar toolbar = FindViewById <Toolbar>(Resource.Id.toolbarSurvey);
            CollapsingToolbarLayout collapsingToolbar = FindViewById <CollapsingToolbarLayout>(Resource.Id.collapsingToolbarSurvey);
            AppBarLayout            appBarLayout      = FindViewById <AppBarLayout>(Resource.Id.appBarSurvey);

            toolbar.Title = "";
            SetSupportActionBar(toolbar);
            var isShow      = false;
            var scrollRange = -1;

            appBarLayout.OffsetChanged += (sender, args) =>
            {
                if (scrollRange == -1)
                {
                    scrollRange = appBarLayout.TotalScrollRange;
                }
                if (scrollRange + args.VerticalOffset == 0)
                {
                    collapsingToolbar.Title = "Escribe una reseña";
                    isShow = true;
                }
                else if (isShow)
                {
                    collapsingToolbar.Title = string.Empty;
                    isShow = false;
                }
            };
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
        }
Ejemplo n.º 4
0
        private void InitComponent(View view)
        {
            try
            {
                MRecycler        = (RecyclerView)view.FindViewById(Resource.Id.recyler);
                EmptyStateLayout = view.FindViewById <ViewStub>(Resource.Id.viewStub);

                LoadingLinear            = (LinearLayout)view.FindViewById(Resource.Id.Loading_LinearLayout);
                LoadingLinear.Visibility = ViewStates.Visible;

                ViewPagerView = view.FindViewById <ViewPager>(Resource.Id.viewpager2);

                MainAppBarLayout = view.FindViewById <AppBarLayout>(Resource.Id.mainAppBarLayout);
                MainAppBarLayout.SetExpanded(false);

                CollapsingToolbarLayout = (CollapsingToolbarLayout)view.FindViewById(Resource.Id.collapsingToolbar);
                //CollapsingToolbarLayout.Title = AppSettings.ApplicationName;
                CollapsingToolbarLayout.Title = "Discover";

                SwipeRefreshLayout = (SpringView)view.FindViewById(Resource.Id.material_style_ptr_frame);
                SwipeRefreshLayout.SetType(SpringView.Type.Overlap);
                SwipeRefreshLayout.Header = new Helpers.PullSwipeStyles.DefaultHeader(Activity);
                SwipeRefreshLayout.Footer = new Helpers.PullSwipeStyles.DefaultFooter(Activity);
                SwipeRefreshLayout.Enable = true;
                SwipeRefreshLayout.SetListener(this);

                MainAlert            = (RelativeLayout)view.FindViewById(Resource.Id.mainAlert);
                MainAlert.Visibility = !UserDetails.IsLogin ? ViewStates.Visible : ViewStates.Gone;
                MainAlert.Click     += MainAlertOnClick;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Ejemplo n.º 5
0
        public HowToRenderer(Context context) : base(context)
        {
            mainActivity = Context as MainActivity;

            _androidLinearLayout = new LinearLayout(Context)
            {
                LayoutParameters = new LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent)
            };

            _androidAppBarLayout = (AppBarLayout)LayoutInflater.FromContext(context).Inflate(Resource.Layout.Toolbar, null);

            toolbar = (Toolbar)_androidAppBarLayout.FindViewById(Resource.Id.toolbar);
            toolbar.FindViewById <TextView>(Resource.Id.cycles_text).Text = "How To Cycle";
            toolbar.FindViewById <Android.Widget.ImageButton>(Resource.Id.gift_button).Visibility = ViewStates.Invisible;

            _androidLinearLayout.AddView(_androidAppBarLayout);

            _androidAppBarLayout.LayoutParameters =
                new LinearLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.WrapContent);

            AddView(_androidLinearLayout);

            mainActivity.SetSupportActionBar(toolbar);
            ActionBar actionBar = mainActivity.SupportActionBar;

            actionBar.SetDisplayHomeAsUpEnabled(true);
            actionBar.Title = "How To Cycle";
            actionBar.SetDisplayShowHomeEnabled(true);
            actionBar.SetDisplayShowTitleEnabled(false);
        }
        protected override void OnElementChanged(ElementChangedEventArgs <NavigationPage> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null)
            {
                if (_toolbar != null)
                {
                    _toolbar.RemoveFromParent();
                }
            }

            if (e.NewElement != null)
            {
                _toolbar = (Toolbar)GetChildAt(0);

                var getNavBarHeight = typeof(NavigationPageRenderer).GetMethod("ActionBarHeight", BindingFlags.Instance | BindingFlags.NonPublic);
                _barHeight = (int)getNavBarHeight.Invoke(this, new object[] { });

                _appBarLayout = (Context as FormsAppCompatActivity).FindViewById <AppBarLayout>(Resource.Id.coordinatorAppBar);

                _toolbar.RemoveFromParent();

                using (var toolbarParams = new AppBarLayout.LayoutParams(LayoutParams.MatchParent, _barHeight))
                {
                    toolbarParams.ScrollFlags = AppBarLayout.LayoutParams.ScrollFlagScroll | AppBarLayout.LayoutParams.ScrollFlagEnterAlways;
                    _appBarLayout.AddView(_toolbar, toolbarParams);
                }
            }
        }
 public void OnOffsetChanged(AppBarLayout appBarLayout, int i)
 {
     if (i == 0)
     {
         if (mCurrentState != State.EXPANDED)
         {
             OnStateChanged(appBarLayout, State.EXPANDED);
         }
         mCurrentState = State.EXPANDED;
     }
     else if (Math.Abs(i) >= appBarLayout.TotalScrollRange)
     {
         if (mCurrentState != State.COLLAPSED)
         {
             OnStateChanged(appBarLayout, State.COLLAPSED);
         }
         mCurrentState = State.COLLAPSED;
     }
     else
     {
         if (mCurrentState != State.IDLE)
         {
             OnStateChanged(appBarLayout, State.IDLE);
         }
         mCurrentState = State.IDLE;
     }
     appBarLayout.AddOnOffsetChangedListener(this);
 }
        private void InitComponent(View view)
        {
            try
            {
                MRecycler        = (RecyclerView)view.FindViewById(Resource.Id.recylerSongsPlaylist);
                EmptyStateLayout = view.FindViewById <ViewStub>(Resource.Id.viewStub);

                CollapsingToolbar       = view.FindViewById <CollapsingToolbarLayout>(Resource.Id.collapsingToolbar);
                CollapsingToolbar.Title = "";

                AppBarLayout = view.FindViewById <AppBarLayout>(Resource.Id.appBarLayout);
                AppBarLayout.SetExpanded(true);
                AppBarLayout.AddOnOffsetChangedListener(this);

                InfoPlaylistViewPager = view.FindViewById <ViewPager>(Resource.Id.viewpager);
                CircleIndicator       = view.FindViewById <CircleIndicator>(Resource.Id.indicator);

                TxtNamePlaylist  = view.FindViewById <TextView>(Resource.Id.name);
                TxtPublisherName = view.FindViewById <TextView>(Resource.Id.publishername);

                BackIcon        = view.FindViewById <ImageView>(Resource.Id.back);
                BackIcon.Click += BackIcon_Click;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Ejemplo n.º 9
0
        private void InitComponent(View view)
        {
            try
            {
                SearchView = view.FindViewById <SearchView>(Resource.Id.searchviewbox);
                SearchView.SetQuery("", false);
                SearchView.ClearFocus();
                SearchView.OnActionViewExpanded();
                SearchView.SetIconifiedByDefault(true);
                SearchView.OnActionViewExpanded();

                //Change text colors
                var editText = (EditText)SearchView.FindViewById(Resource.Id.search_src_text);
                editText.SetHintTextColor(Color.Gray);
                editText.SetTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.Black);

                TabLayout = view.FindViewById <TabLayout>(Resource.Id.Searchtabs);
                ViewPager = view.FindViewById <ViewPager>(Resource.Id.Searchviewpager);

                AppBarLayout = view.FindViewById <AppBarLayout>(Resource.Id.mainAppBarLayout);
                AppBarLayout.SetExpanded(true);

                //Set Tab
                ViewPager.OffscreenPageLimit = 2;
                SetUpViewPager(ViewPager);
                TabLayout.SetupWithViewPager(ViewPager);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Ejemplo n.º 10
0
            public void OnOffsetChanged(AppBarLayout appBarLayout, int verticalOffset)
            {
                int   maxScroll  = appBarLayout.TotalScrollRange;
                float percentage = (float)Math.Abs(verticalOffset) / (float)maxScroll;

                ViewCompat.SetAlpha(statusBarView, percentage);
            }
            public override void OnStateChanged(AppBarLayout appBarLayout, State state, int verticalOffset)
            {
                if (state == State.EXPANDED)
                {
                    //展开状态
                    v_detail.mTvPlayer.Visibility = ViewStates.Gone;    // .setVisibility(View.GONE);
                    v_detail.mAvText.Visibility   = ViewStates.Visible; // .setVisibility(View.VISIBLE);
                    v_detail.mToolbar.SetContentInsetsRelative(DisplayUtil.dp2px(v_detail.BaseContext, 15), 0);
                }
                else if (state == State.COLLAPSED)
                {
                    //折叠状态
                    v_detail.mTvPlayer.Visibility = ViewStates.Visible; //.setVisibility(View.VISIBLE);
                    v_detail.mAvText.Visibility   = ViewStates.Gone;    //.setVisibility(View.GONE);
                    v_detail.mToolbar.SetContentInsetsRelative(DisplayUtil.dp2px(v_detail, 150), 0);
                }
                else
                {
                    v_detail.mTvPlayer.Visibility = ViewStates.Gone;    //.setVisibility(View.GONE);
                    v_detail.mAvText.Visibility   = ViewStates.Visible; //.setVisibility(View.VISIBLE);
                    v_detail.mToolbar.SetContentInsetsRelative(DisplayUtil.dp2px(v_detail, 15), 0);
                }
                //if (v_detail.mCollapsingToolbarLayout.NestedScrollingEnabled)
                //{

                //}
            }
Ejemplo n.º 12
0
 private void DestroyBasic()
 {
     try
     {
         TabLayout                = null;
         ViewPager                = null;
         AppBarLayout             = null;
         HashRecyclerView         = null;
         Toolbar                  = null;
         SearchText               = null;
         OffsetUser               = "";
         OffsetPage               = "";
         OffsetGroup              = "";
         DataKey                  = "";
         SearchText               = "";
         UserTab                  = null;
         PagesTab                 = null;
         GroupsTab                = null;
         FloatingActionButtonView = null;
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
Ejemplo n.º 13
0
 public void OnOffsetChanged(AppBarLayout layout, int verticalOffset)
 {
     if (verticalOffset == 0)
     {
         if (CollapsingState != CollapsingToolbarLayoutState.Expanded)
         {
             CollapsingState   = CollapsingToolbarLayoutState.Expanded; //修改状态标记为展开
             toolbarTitle.Text = "";                                    //设置title不显示
         }
     }
     else if (Math.Abs(verticalOffset) >= layout.TotalScrollRange)
     {
         if (CollapsingState != CollapsingToolbarLayoutState.Collapsed)
         {
             toolbarTitle.Text = title;                                  //设置title显示
             CollapsingState   = CollapsingToolbarLayoutState.Collapsed; //修改状态标记为折叠
         }
     }
     else
     {
         if (CollapsingState != CollapsingToolbarLayoutState.Internediate)
         {
             CollapsingState   = CollapsingToolbarLayoutState.Internediate; //修改状态标记为中间
             toolbarTitle.Text = "";                                        //设置title不显示
         }
     }
 }
Ejemplo n.º 14
0
        /// <summary>
        /// Creates the activity and maps the Xamarin.Forms page to the fragment
        /// </summary>
        /// <param name="savedInstanceState">Saved instance state.</param>
        protected override void OnCreate(Android.OS.Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.xamarin_forms_activity);

            Toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            if (Toolbar?.Parent != null)
            {
                AppBar = Toolbar?.Parent as AppBarLayout;
                SetSupportActionBar(Toolbar);
            }

            // register the fragment
            var transaction = SupportFragmentManager.BeginTransaction();

            transaction.Add(Resource.Id.activity_container_fragment, _page.CreateSupportFragment(this));
            transaction.Commit();

            SupportActionBar?.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar?.SetDisplayShowHomeEnabled(true);
            //Toolbar?.SetBackgroundColor(Android.Graphics.Color.White);
            Toolbar?.SetBackgroundColor(Android.Graphics.Color.Transparent);
            // everything else from this point should be managed by the Xamarin.Forms page behind the fragment

            navigationService = SimpleIoc.Default.GetInstance <IViewNavigationService>();
        }
 public void OnOffsetChanged(AppBarLayout appBarLayout, int verticalOffset)
 {
     if (verticalOffset == 0)
     {
         if (mCurrentState != State.EXPANDED)
         {
             OnStateChanged(appBarLayout, State.EXPANDED, verticalOffset);
         }
         mCurrentState = State.EXPANDED;
     }
     else if (Math.Abs(verticalOffset) >= appBarLayout.TotalScrollRange)
     {
         if (mCurrentState != State.COLLAPSED)
         {
             OnStateChanged(appBarLayout, State.COLLAPSED, verticalOffset);
         }
         mCurrentState = State.COLLAPSED;
     }
     else
     {
         if (mCurrentState != State.IDLE)
         {
             OnStateChanged(appBarLayout, State.IDLE, verticalOffset);
         }
         mCurrentState = State.IDLE;
     }
 }
Ejemplo n.º 16
0
        public void OnOffsetChanged(AppBarLayout appBarLayout, int verticalOffset)
        {
            // fab should scroll out down in sync with the appBarLayout scrolling out up.
            // let's see how far along the way the appBarLayout is
            // (if displacementFraction == 0.0f then no displacement, appBar is fully expanded;
            //  if displacementFraction == 1.0f then full displacement, appBar is totally collapsed)
            float displacementFraction = -verticalOffset / (float)appBarLayout.Height;

            // need to separate translationY on the fab that comes from this behavior
            // and one that comes from other sources
            // translationY from this behavior is stored in a tag on the fab
            float translationYFromThis = (float)(float?)_fab.GetTag(Resource.Id.fab_translationY_from_AppBarBoundFabBehavior);

            // top position, accounting for translation not coming from this behavior
            float topUntranslatedFromThis = _fab.Top + _fab.TranslationY - translationYFromThis;

            // total length to displace by (from position uninfluenced by this behavior) for a full appBar collapse
            float fullDisplacement = _parent.Bottom - topUntranslatedFromThis;

            // calculate and store new value for displacement coming from this behavior
            float newTranslationYFromThis = fullDisplacement * displacementFraction;

            _fab.SetTag(Resource.Id.fab_translationY_from_AppBarBoundFabBehavior, newTranslationYFromThis);

            // update translation value by difference found in this step
            _fab.TranslationY = newTranslationYFromThis - translationYFromThis + _fab.TranslationY;
        }
Ejemplo n.º 17
0
        private void InitComponent(View view)
        {
            try
            {
                ImageCoverChannel      = view.FindViewById <ImageView>(Resource.Id.myImagevideo);
                ImageChannel           = view.FindViewById <ImageView>(Resource.Id.myChannelImage);
                CollapsingToolbar      = view.FindViewById <CollapsingToolbarLayout>(Resource.Id.mycollapsingToolbar);
                ChannelNameText        = view.FindViewById <TextView>(Resource.Id.myChannelName);
                ChannelVerifiedText    = view.FindViewById <TextView>(Resource.Id.myChannelVerifiedText);
                IconSettings           = view.FindViewById <ImageView>(Resource.Id.mySettings_icon);
                SubscribeChannelButton = view.FindViewById <Button>(Resource.Id.mySubcribeChannelButton);

                Tabs          = view.FindViewById <TabLayout>(Resource.Id.mychanneltabs);
                ViewPagerView = view.FindViewById <ViewPager>(Resource.Id.myChannelviewpager);
                AppBarLayout  = view.FindViewById <AppBarLayout>(Resource.Id.mymainAppBarLayout);
                AppBarLayout.SetExpanded(true);

                SubscribeChannelButton.Text = GetText(Resource.String.Lbl_Edit);

                ChannelVerifiedText.Visibility = ViewStates.Gone;
                FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, ChannelVerifiedText, IonIconsFonts.CheckmarkCircled);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Ejemplo n.º 18
0
        public void Initialize()
        {
            // Create your application here
            getQuoteButton  = FindViewById <Button>(Resource.Id.requestCourier_getQuoteButton);
            email           = FindViewById <EditText>(Resource.Id.requestCourier_etemail);
            phone           = FindViewById <EditText>(Resource.Id.requestCourier_etphone);
            name            = FindViewById <EditText>(Resource.Id.requestCourier_etname);
            message         = FindViewById <TextView>(Resource.Id.requestCourier_tvmessage);
            vehiclebodytype = FindViewById <Spinner>(Resource.Id.requestCourier_vehiclebodytype);
            appBar          = FindViewById <AppBarLayout>(Resource.Id.appbar);

            requestCourierViewModel = new RequestCourierViewModel();
            getQuoteButton.Click   += GetQuoteButton_Click;

            //set vehicle body type drop down
            //List<string> mylist = new List<string>();
            //var adapter = ArrayAdapter.CreateFromResource(this, Resource.Array.vehiclebodytypes_array, Android.Resource.Layout.SimpleSpinnerDropDownItem);
            //adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            //vehiclebodytype.Adapter = adapter;

            pickupLocation = FindViewById <AutoCompleteTextView>(Resource.Id.requestCourier_actvpickup_location);
            dropLocation   = FindViewById <AutoCompleteTextView>(Resource.Id.requestCourier_actvdrop_location);

            pickupLocation.TextChanged += PickupLocationAutocomplete;
            dropLocation.TextChanged   += DropLocationAutocomplete;
        }
Ejemplo n.º 19
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.tv_episode_detail);

            toolbar = FindViewById<Toolbar>(Resource.Id.image_toolbar_main_toolbar);
            appBarLayout = FindViewById<AppBarLayout>(Resource.Id.image_toolbar_appbar_layout);
            collapseToolbar = FindViewById<CollapsingToolbarLayout>(Resource.Id.image_toolbar_collapsing_layout);
            collapseToolbar.TitleEnabled = true;
            titleContainer = FindViewById<Android.Widget.LinearLayout>(Resource.Id.image_toolbar_collapsing_root);
            
            dataRV = FindViewById<RecyclerView>(Resource.Id.tv_episode_detail_rv);
            dataRV.SetLayoutManager(new CachingLayoutManager(this));
            loadingView = FindViewById<ContentLoadingProgressBar>(Resource.Id.image_toolbar_loading);

            AppView.SetActionBarForActivity(toolbar, this);
            appBarLayout.OffsetChanged += AppLayout_OffsetChanged;
            callBack = new JavaValueCallback();
            callBack.ValueReceived += JavaCallBack_ValueReceived;

            canGoBackToSeriesHome = Intent.GetBooleanExtra("canGoBackToSeriesHome", false);
            var link = Intent.GetStringExtra("itemLink");
            LoadEpisodeData(link);
        }
Ejemplo n.º 20
0
 private void DestroyBasic()
 {
     try
     {
         TabLayout = null!;
         ViewPager = null!;
         AppBarLayout = null!;
         HashRecyclerView = null!;
         Toolbar = null!;
         SearchText = null!;
         OffsetUser = "";
         OffsetPage = "";
         OffsetGroup = "";
         DataKey = "";
         SearchText = ""; 
         UserTab = null!;
         PagesTab = null!;
         GroupsTab = null!;
         FloatingActionButtonView = null!; 
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }
Ejemplo n.º 21
0
        public void InitToolbar(string name)
        {
            Toolbar toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            CollapsingToolbarLayout collapsingToolbar = FindViewById <CollapsingToolbarLayout>(Resource.Id.collapsingToolbar);
            AppBarLayout            appBarLayout      = FindViewById <AppBarLayout>(Resource.Id.appBar);

            toolbar.Title = "";
            SetSupportActionBar(toolbar);
            var isShow      = false;
            var scrollRange = -1;

            appBarLayout.OffsetChanged += (sender, args) =>
            {
                if (scrollRange == -1)
                {
                    scrollRange = appBarLayout.TotalScrollRange;
                }
                if (scrollRange + args.VerticalOffset == 0)
                {
                    collapsingToolbar.Title = name;
                    isShow = true;
                }
                else if (isShow)
                {
                    collapsingToolbar.Title = string.Empty;
                    isShow = false;
                }
            };
        }
        protected override void OnCreate(Android.OS.Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.xamarin_forms_activity);

            Toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            if (Toolbar?.Parent != null)
            {
                AppBar = Toolbar?.Parent as AppBarLayout;
                SetSupportActionBar(Toolbar);
            }
            if (!Xamarin.Forms.Forms.IsInitialized)
            {
                Xamarin.Forms.Forms.Init(this, null);
            }

            NavigationImplementation.context = this;
            var transaction = SupportFragmentManager.BeginTransaction();

            transaction.Add(Resource.Id.fragment_container, _page.CreateSupportFragment(this));
            transaction.Commit();
            SupportActionBar?.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar?.SetDisplayShowHomeEnabled(true);
            //Toolbar?.SetBackgroundColor(Android.Graphics.Color.White);
        }
Ejemplo n.º 23
0
 private void DestroyBasic()
 {
     try
     {
         ToolbarLayout      = null;
         AppBarLayout       = null;
         TxtName            = null;
         TxtGoing           = null;
         TxtInterested      = null;
         TxtStartDate       = null;
         TxtEndDate         = null;
         TxtLocation        = null;
         TxtDescription     = null;
         TxtDescriptionText = null;
         ImageEventCover    = null;
         BtnGo                    = null;
         BtnInterested            = null;
         FloatingActionButtonView = null;
         MainRecyclerView         = null;
         BtnMore                  = null;
         SwipeRefreshLayout       = null;
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
        public void OnOffsetChanged(AppBarLayout appBarLayout, int verticalOffset)
        {
            ScrollRange = ScrollRange switch
            {
                -1 => appBarLayout.TotalScrollRange,
                _ => ScrollRange
            };

            switch (ScrollRange + verticalOffset)
            {
            case 0:
                ToolbarLayout.Title = Name;
                IsShow = true;
                break;

            default:
            {
                switch (IsShow)
                {
                case true:
                    ToolbarLayout.Title = " ";
                    IsShow = false;
                    break;
                }

                break;
            }
            }
        }
    }
Ejemplo n.º 25
0
 private void DestroyBasic()
 {
     try
     {
         ToolbarLayout      = null !;
         AppBarLayout       = null !;
         TxtName            = null !;
         TxtGoing           = null !;
         TxtInterested      = null !;
         TxtStartDate       = null !;
         TxtEndDate         = null !;
         TxtLocation        = null !;
         TxtDescription     = null !;
         TxtDescriptionText = null !;
         ImageEventCover    = null !;
         BtnGo                    = null !;
         BtnInterested            = null !;
         FloatingActionButtonView = null !;
         MainRecyclerView         = null !;
         BtnMore                  = null !;
         SwipeRefreshLayout       = null !;
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }
Ejemplo n.º 26
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            RequestWindowFeature(WindowFeatures.NoTitle);
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            appBarLayout = FindViewById <AppBarLayout>(Resource.Id.appbar);
            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            appBarLayout.OffsetChanged += (sender, args) =>
            {
                intColorCode = -(args.VerticalOffset);
                if (intColorCode > 400)
                {
                    intColorCode = 255;
                }

                else
                {
                    intColorCode = intColorCode - 150;
                }

                toolbar.Background.Alpha = intColorCode;
                toolbar.Alpha            = intColorCode;
            };
        }
Ejemplo n.º 27
0
        private void InitComponent(View view)
        {
            try
            {
                TabLayout = view.FindViewById <TabLayout>(Resource.Id.Searchtabs);
                ViewPager = view.FindViewById <ViewPager>(Resource.Id.Searchviewpager);

                AppBarLayout = view.FindViewById <AppBarLayout>(Resource.Id.mainAppBarLayout);
                AppBarLayout.SetExpanded(true);

                //Set Tab
                ViewPager.OffscreenPageLimit = 2;
                SetUpViewPager(ViewPager);
                TabLayout.SetupWithViewPager(ViewPager);

                FilterButton = (TextView)view.FindViewById(Resource.Id.filter_icon);
                FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, FilterButton, IonIconsFonts.AndroidOptions);
                FilterButton.Click += FilterButtonOnClick;

                GetAppData();

                AdsGoogle.Ad_Interstitial(Context);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        protected override void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            _disposed = true;

            if (disposing)
            {
                _shellContext.Shell.PropertyChanged -= OnShellPropertyChanged;

                if (_flyoutHeader != null)
                {
                    _flyoutHeader.MeasureInvalidated -= OnFlyoutHeaderMeasureInvalidated;
                }

                if (_appBar != null)
                {
                    _appBar.RemoveOnOffsetChangedListener(this);
                    _appBar.RemoveView(_headerView);
                }

                if (_rootView != null && _footerView?.NativeView != null)
                {
                    _rootView.RemoveView(_footerView.NativeView);
                }

                if (_recycler != null)
                {
                    _recycler.SetLayoutManager(null);
                    _recycler.SetAdapter(null);
                    _recycler.Dispose();
                }

                _adapter?.Dispose();
                _headerView.Dispose();
                _footerView?.TearDown();
                _rootView.Dispose();
                _layoutManager?.Dispose();
                _defaultBackgroundColor?.Dispose();
                _bgImage?.Dispose();

                _flyoutHeader           = null;
                _rootView               = null;
                _headerView             = null;
                _shellContext           = null;
                _appBar                 = null;
                _recycler               = null;
                _adapter                = null;
                _defaultBackgroundColor = null;
                _layoutManager          = null;
                _bgImage                = null;
                _footerView             = null;
            }

            base.Dispose(disposing);
        }
Ejemplo n.º 29
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            var info = FamiStudioForm.Instance != null ? FamiStudioForm.Instance.ActiveDialog as PropertyDialogActivityInfo : null;

            if (savedInstanceState != null || info == null)
            {
                Finish();
                return;
            }

            dlg = info.Dialog;
            dlg.CloseRequested += Dlg_CloseRequested;

            var appBarLayoutParams = new AppBarLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, DroidUtils.GetSizeAttributeInPixel(this, Android.Resource.Attribute.ActionBarSize));

            appBarLayoutParams.ScrollFlags = 0;

            toolbar = new AndroidX.AppCompat.Widget.Toolbar(new ContextThemeWrapper(this, Resource.Style.ToolbarTheme));
            toolbar.LayoutParameters = appBarLayoutParams;
            toolbar.SetTitleTextAppearance(this, Resource.Style.LightGrayTextMediumBold);
            SetSupportActionBar(toolbar);

            ActionBar actionBar = SupportActionBar;

            if (actionBar != null)
            {
                actionBar.SetDisplayHomeAsUpEnabled(true);
                actionBar.SetHomeButtonEnabled(true);
                actionBar.SetHomeAsUpIndicator(Android.Resource.Drawable.IcMenuCloseClearCancel);
                actionBar.Title = dlg.Title;
            }

            appBarLayout = new AppBarLayout(this);
            appBarLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
            appBarLayout.AddView(toolbar);

            fragmentView = new FragmentContainerView(this);
            fragmentView.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
            fragmentView.Id = FragmentViewId;

            var scrollViewLayoutParams = new CoordinatorLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);

            scrollViewLayoutParams.Behavior = new AppBarLayout.ScrollingViewBehavior(this, null);

            scrollView = new NestedScrollView(new ContextThemeWrapper(this, Resource.Style.DarkBackgroundStyle));
            scrollView.LayoutParameters = scrollViewLayoutParams;
            scrollView.AddView(fragmentView);

            coordLayout = new CoordinatorLayout(this);
            coordLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
            coordLayout.AddView(appBarLayout);
            coordLayout.AddView(scrollView);

            SetContentView(coordLayout);

            SupportFragmentManager.BeginTransaction().SetReorderingAllowed(true).Add(fragmentView.Id, dlg.Properties, "PropertyDialog").Commit();
        }
Ejemplo n.º 30
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            mapGraph = MainApp.Instance.MainBuildingGraph.Value;

            view = inflater.Inflate(Resource.Layout.fragment_mainbuilding, container, false);

            fragments = new List <MainBuildingMapFragment>()
            {
                new MainBuildingMapFragment(Resource.Drawable.first_floor), new MainBuildingMapFragment(Resource.Drawable.second_floor), new MainBuildingMapFragment(Resource.Drawable.third_floor)
            };

            fragmentTransaction = Activity.SupportFragmentManager.BeginTransaction();
            fragmentTransaction.Add(Resource.Id.frame_mainbuilding, fragments[2], "MAP_MAINBUILDING_3");
            fragmentTransaction.Add(Resource.Id.frame_mainbuilding, fragments[1], "MAP_MAINBUILDING_2");
            fragmentTransaction.Detach(fragments[2]);
            fragmentTransaction.Detach(fragments[1]);
            fragmentTransaction.Add(Resource.Id.frame_mainbuilding, fragments[0], "MAP_MAINBUILDING_1");
            fragmentTransaction.Commit();

            var array = MainApp.Instance.RoomsDictionary.Select(x => x.Key).ToArray();

            editTextInputFrom              = view.FindViewById <AutoCompleteTextView>(Resource.Id.autoCompleteTextView_from);
            editTextInputFrom.FocusChange += EditTextFromFocusChanged;
            editTextInputFrom.Adapter      = new ArrayAdapter(Activity.BaseContext, Android.Resource.Layout.SimpleDropDownItem1Line, array);
            editTextInputFrom.AddTextChangedListener(this);

            editTextInputTo = view.FindViewById <AutoCompleteTextView>(Resource.Id.autoCompleteTextView_to);
            editTextInputTo.SetOnEditorActionListener(this);
            editTextInputTo.FocusChange += EditTextToFocusChanged;
            editTextInputTo.Adapter      = new ArrayAdapter(Activity.BaseContext, Android.Resource.Layout.SimpleDropDownItem1Line, array);
            editTextInputTo.AddTextChangedListener(this);

            appBar = view.FindViewById <AppBarLayout>(Resource.Id.appbar_mainbuilding);
            appBar.AddOnOffsetChangedListener(this);

            fab        = view.FindViewById <FloatingActionButton>(Resource.Id.fab_mainbuilding);
            fab.Click += Fab_Click;

            relativeLayout       = view.FindViewById <RelativeLayout>(Resource.Id.search_frame_mainbuilding);
            relativeLayoutParams = (AppBarLayout.LayoutParams)relativeLayout.LayoutParameters;

            frameLayout     = view.FindViewById <FrameLayout>(Resource.Id.frame_mainbuilding);
            fabLayoutParams = (CoordinatorLayout.LayoutParams)fab.LayoutParameters;

            var rl = view.FindViewById <RelativeLayout>(Resource.Id.relativelayout_floor_buttons_mainbuilding);

            rl.BringToFront();

            buttonUp        = view.FindViewById <FloatingActionButton>(Resource.Id.fab_up_mainbuilding);
            buttonUp.Click += ButtonUp_Click;
            buttonUp.Alpha  = 0.7f;

            buttonDown         = view.FindViewById <FloatingActionButton>(Resource.Id.fab_down_mainbuilding);
            buttonDown.Click  += ButtonDown_Click;
            buttonDown.Alpha   = 0.7f;
            buttonDown.Enabled = false;

            return(view);
        }
        private SessionDetailFragmentBinding(LayoutInflater inflater, ViewGroup root, bool attachToRoot)
        {
            Root = inflater.Inflate(Resource.Layout.fragment_session_detail, root, attachToRoot);

            fab = Root.FindViewById<FloatingActionButton>(Resource.Id.fab);
            toolbar = Root.FindViewById<Toolbar>(Resource.Id.toolbar);
            appbar = Root.FindViewById<AppBarLayout>(Resource.Id.app_bar);
            collapsingToolbar = Root.FindViewById<CollapsingToolbarLayout>(Resource.Id.collapsing_toolbar);
            txtSessionTimeRange = Root.FindViewById<TextView>(Resource.Id.txt_session_time_range);
            imgCover = Root.FindViewById<ImageView>(Resource.Id.img_cover);
            txtPlace = Root.FindViewById<TextView>(Resource.Id.txt_place);
            txtCategory = Root.FindViewById<CategoryView>(Resource.Id.txt_category);
            txtLanguage = Root.FindViewById<TextView>(Resource.Id.txt_language);
            txtSpeakerTitle = Root.FindViewById<TextView>(Resource.Id.txt_speaker_title);
            imgSpeaker = Root.FindViewById<ImageView>(Resource.Id.img_speaker);
            txtSpeakerName = Root.FindViewById<TextView>(Resource.Id.txt_speaker_name);
            txtDescriptionTitle = Root.FindViewById<TextView>(Resource.Id.txt_description_title);
            txtDescriptionDetail = Root.FindViewById<TextView>(Resource.Id.txt_description_detail);
            txtFeedback = Root.FindViewById<TextView>(Resource.Id.txt_feedback);
            fab = Root.FindViewById<FloatingActionButton>(Resource.Id.fab);
            speakerSnsIcons = Root.FindViewById<SpeakerSnsIconsView>(Resource.Id.speaker_sns_icons);
        }