예제 #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            MainApp.ChangeLanguage(this);
            SetTheme(Resource.Style.MyAppTheme);
            base.OnCreate(savedInstanceState);

            startActivity = MainApp.Instance.SharedPreferences.GetString("startactivity", null);
            string str = MainApp.Instance.SharedPreferences.GetString("language", null);

            SetContentView(Resource.Layout.activity_main);

            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawerlayout_main);
            drawerLayout.AddDrawerListener(this);
            drawerLayout.SetStatusBarBackground(Resource.Color.color_status_bar);

            toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar_main);

            drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);
            drawerLayout.AddDrawerListener(drawerToggle);

            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.baseline_menu_black);

            navigationView = FindViewById <NavigationView>(Resource.Id.navview_main);
            navigationView.NavigationItemSelected += NavViewItemSelected;
            navigationView.Alpha = 0.99f;
            InstantiateFragment();
        }
예제 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.home_activity);

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            ISharedPreferences pref = Application.Context.GetSharedPreferences("UserInfor", FileCreationMode.Private);

            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            DrawerLayout          drawer1 = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle1 = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.SetNavigationItemSelectedListener(this);

            Button btn = FindViewById <Button>(Resource.Id.btnsignout);

            btn.Click += button_click;

            TextView greeting = FindViewById <TextView>(Resource.Id.txtWelcome);

            greeting.Text = "Welcome \n" + Intent.GetStringExtra("Username");
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            ThreadPool.QueueUserWorkItem(o => LoadUser());
            SetContentView(Resource.Layout.activity_search);
            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.SetNavigationItemSelectedListener(this);

            _lv = FindViewById <ListView>(Resource.Id.lvSearched);

            SearchView searchButton = FindViewById <SearchView>(Resource.Id.searchButton);

            searchButton.SetQueryHint("Enter your query");
            searchButton.SetIconifiedByDefault(false);
            searchButton.QueryTextSubmit += (sender, e) =>
            {
                ThreadPool.QueueUserWorkItem(o => GetGalleryImagesAsync(searchButton.Query));
            };
        }
예제 #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            fragment = new List <Android.Support.V4.App.Fragment>();
            fragment.Add(new FragmentHome());
            fragment.Add(new Fragment_RecepcionPaquetes());
            fragment.Add(new Fragment_InventarioPaquetes());
            fragment.Add(new fragment_TransitoPaquetes());
            fragment.Add(new fragment_ConsultaPaquetes());
            fragment.Add(new fragment_PreparacionDespacho());
            fragment.Add(new fragment_PreparacionConduce());
            fragment.Add(new Fragment_DespachoSucursal());

            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.content_frame, fragment[0])
            .Commit();

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);


            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.SetNavigationItemSelectedListener(this);
        }
예제 #5
0
        //#region EMDKVariables
        //private TextView statusView = null;
        //private TextView dataView = null;

        //EMDKManager emdkManager = null;
        //BarcodeManager barcodeManager = null;
        //Scanner scanner = null;
        //#endregion

        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_main);
            Toolbar toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);
            StatusBar();
            //InitializeEMDK();
            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            this.toggle  = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);
            drawerLayout.AddDrawerListener(this.toggle);

            this.navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            if (savedInstanceState == null)
            {
                SupportFragmentManager.BeginTransaction().Add(Resource.Id.fragment, new MenusFragment()).Commit();
            }
            else
            {
                navigationView.SetCheckedItem(Resource.Id.home);
            }

            //ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(Application.Context);
            //String myData = prefs.GetString("my_data", "");
        }
예제 #6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            manager = SupportFragmentManager;
            ft      = manager.BeginTransaction();

            // Create your application here
            SetContentView(Resource.Layout.Navigation_2);
            fab = FindViewById <FloatingActionButton>(Resource.Id.fab);
            fab.Hide();

            fragment = new HomeFragment();
            ft.Replace(Resource.Id.frame, fragment).Commit();

            // ft.Show(fragment);
            drawerlayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            nav_view     = FindViewById <NavigationView>(Resource.Id.nav_view);

            Toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(Toolbar);
            drawertoggle = new MyActionBar(this, drawerlayout, Resource.String.drawer_open, Resource.String.drawer_close);
            drawerlayout.AddDrawerListener(drawertoggle);
            nav_view.NavigationItemSelected += NavigationView_NavigationItemSelected;
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);
            drawertoggle.SyncState();
        }
예제 #7
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            var toolbar   = FindViewById <V7Toolbar>(Resource.Id.toolbar);
            var lstVwMenu = FindViewById <ListView>(Resource.Id.lstVwMenuItems);

            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawerLayout);
            var listMenuItems = new List <string>();

            listMenuItems.Add("Boot raus");
            listMenuItems.Add("Aktuell draußen");
            listMenuItems.Add("Tagesverlauf");
            listMenuItems.Add("LOGOUT");
            var adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleListItem1, Android.Resource.Id.Text1, listMenuItems.ToArray());

            lstVwMenu.Adapter = adapter;
            SetSupportActionBar(toolbar);
            SupportActionBar.Title = "LSP";
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayShowTitleEnabled(false);
            actionBarDrawerToggle = new ActionBarDrawerToggle(this, drawerLayout, Resource.String.openDrawer, Resource.String.closeDrawer);
            drawerLayout.AddDrawerListener(actionBarDrawerToggle);
            actionBarDrawerToggle.SyncState();
            lstVwMenu.ItemClick += LstVwMenu_ItemSelected;
            //SetupDB();
        }
예제 #8
0
        /// <summary>
        /// Setups the side menu.
        /// </summary>
        /// <returns>The side menu.</returns>
        private void SetupSideMenu()
        {
            _drawerLayout = (DrawerLayout)FindViewById(Resource.Id.drawer_layout);

            TextView tvChangeNumberLbl = FindViewById <TextView>(Resource.Id.tvChangeNumberLbl);

            tvChangeNumberLbl.Click += delegate {
                _drawerLayout.CloseDrawer(GravityCompat.Start);

                //StartActivity(new Intent(_context, typeof(ChangeNumberActivity)));

                StartActivityForResult(new Intent(_context, typeof(ChangeNumberActivity)), 1001);
            };


            ImageView imgCloseDrawer = FindViewById <ImageView>(Resource.Id.imgCloseDrawer);

            imgCloseDrawer.Click += delegate {
                _drawerLayout.CloseDrawer(GravityCompat.Start);
            };

            drawerToggle = new MyActionBarDrawerToggle(this,
                                                       _drawerLayout, toolbar,
                                                       Resource.String.open_drawer,
                                                       Resource.String.close_drawer);
            _drawerLayout.AddDrawerListener(drawerToggle);

            SupportActionBar.SetDisplayShowHomeEnabled(true);

            drawerToggle.SyncState();
            drawerToggle.DrawerIndicatorEnabled = true;
        }
예제 #9
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_main);
            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;

            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.SetNavigationItemSelectedListener(this);

            lvDados = FindViewById <ListView>(Resource.Id.lvDados);
            lvDados.FastScrollEnabled = true;
            solicitacoesListView.RemoveRange(0, solicitacoesListView.Count);
            solicitacoesListView = db.GetSolicitacao();
            var adapter = new SolicitacaoAdapter(this, solicitacoesListView);

            lvDados.Adapter    = adapter;
            lvDados.ItemClick += LvDados_ItemClick;
        }
예제 #10
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);
            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            //FloatingActionButton fab = FindViewById<FloatingActionButton>(Resource.Id.fab);
            //fab.Click += FabOnClick;


            DrawerLayout drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);

            Android.Support.V7.App.ActionBarDrawerToggle toggle = new Android.Support.V7.App.ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);
            drawer.AddDrawerListener(toggle);
            toggle.SyncState();
            tx             = FindViewById <TextView>(Resource.Id.textView4);
            navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);
            navigationView.SetNavigationItemSelectedListener(this);
            progress     = FindViewById <TextView>(Resource.Id.textView5);
            progressBar1 = FindViewById <ProgressBar>(Resource.Id.progressBar1);
            LoadAsync();
            CheckUpdate();
        }
예제 #11
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            SetContentView(Resource.Layout.activity_main);
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            //SetContentView(Resource.Layout.LoginForm);
            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;

            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.SetNavigationItemSelectedListener(this);

            //content page items
            RetriveData();
            myRecyclerView = (RecyclerView)FindViewById(Resource.Id.myRecyclerView);

            addMember        = (ImageView)FindViewById(Resource.Id.btnAddMember);
            addMember.Click += delegate
            {
                StartActivity(typeof(newMember));
            };
        }
예제 #12
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.MainView);

            //var toolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            //SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            _drawerListView            = FindViewById <ListView>(Resource.Id.drawerListView);
            _drawerListView.ItemClick += (s, e) => ShowFragmentAt(e.Position);
            _drawerListView.Adapter    = new ArrayAdapter <string>(this, global::Android.Resource.Layout.SimpleListItem1, ViewModel.MenuItems.ToArray());

            _drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawerLayout);

            _drawerToggle = new ActionBarDrawerToggle(
                this,
                _drawerLayout,
                Resource.String.OpenDrawerString,
                Resource.String.CloseDrawerString);

            _drawerLayout.AddDrawerListener(_drawerToggle);



            ShowFragmentAt(0);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_ref);
            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;

            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.SetNavigationItemSelectedListener(this);
            ISharedPreferences sharedprefs = GetSharedPreferences("prefs_file", FileCreationMode.Private);

            campaignText = sharedprefs.GetString("Campaign", null);

            ViewStub stub = FindViewById <ViewStub>(Resource.Id.layout_stub);

            stub.LayoutResource = Resource.Layout.activity_list;
            View inflated = stub.Inflate();

            CreateNotesList();
        }
예제 #14
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_main);
            global::Android.Support.V7.Widget.Toolbar toolbar = FindViewById <global::Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;

            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.SetNavigationItemSelectedListener(this);



            /*mAccountManager = AccountManager.Get(this);
             *
             * if (savedInstanceState != null)
             * {
             *  bool showDialog = savedInstanceState.GetBoolean(STATE_DIALOG);
             *  bool invalidate = savedInstanceState.GetBoolean(STATE_INVALIDATE);
             *  if (showDialog)
             *  {
             *      showAccountPicker(AccountGeneral.AUTHTOKEN_TYPE_FULL_ACCESS, invalidate);
             *  }
             * }*/
        }
예제 #15
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);
            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;

            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.SetNavigationItemSelectedListener(this);

            bool isSuccess = HslControls.Authorization.SetAuthorizationCode("你的授权码");

            if (!isSuccess)
            {
                Console.WriteLine("注册失败");
            }

            new Thread(new ThreadStart(CheckServer))
            {
                IsBackground = true
            }.Start( );
        }
예제 #16
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);
            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;

            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.SetNavigationItemSelectedListener(this);

            var welcomeTransaction = SupportFragmentManager.BeginTransaction();

            welcomeTransaction.Add(Resource.Id.fragment_container, new Welcome(), "Welcome");
            welcomeTransaction.Commit();
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Attach item selected handler to navigation view
            var navigationView = FindViewById <NavigationView>(Resource.Id.left_drawer);

            navigationView.NavigationItemSelected += NavigationView_NavigationItemSelected;

            // Create ActionBarDrawerToggle button and add it to the toolbar
            _drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            _drawerToggle = new ActionBarDrawerToggle(this, _drawerLayout, Toolbar,
                                                      Resource.String.ApplicationName, Resource.String.ApplicationName);
            _drawerLayout.AddDrawerListener(_drawerToggle);
            _drawerToggle.SyncState();

            var prevFragment = FragmentManager.FindFragmentById(Resource.Id.content_frame);

            if (prevFragment == null)
            {
                var ft = FragmentManager.BeginTransaction();
                ft.Add(Resource.Id.content_frame, new HomeFragment());
                ft.Commit();
            }
        }
예제 #18
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            MenuViewModel = MenuViewModel.Instance;
            MusicPlayer   = new MusicPlayer(this);
            SetContentView(Resource.Layout.activity_menu);

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);
            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.SetNavigationItemSelectedListener(this);

            InitViews();

            if (MenuViewModel.currentImage.ImagePath == null)
            {
                StartActivityForResult(new Intent(this, typeof(CameraActivity)), REQUEST_CODE_CAMERA);
            }
            else
            {
                MenuViewModel.image = BitmapFactory.DecodeFile(MenuViewModel.currentImage.ImagePath);
                ShowInformation();
                MenuViewModel.DeleteImage();
            }
        }
예제 #19
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activityNavigation);
            Android.Support.V7.Widget.Toolbar lToolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(lToolbar);

            Drawer = FindViewById <DrawerLayout>(Resource.Id.dlRoot);
            ActionBarDrawerToggle lToggle = new ActionBarDrawerToggle(this, Drawer, lToolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            Drawer.AddDrawerListener(lToggle);
            lToggle.SyncState();

            NavigationView lNavView = FindViewById <NavigationView>(Resource.Id.nvDrawer);

            lNavView.SetNavigationItemSelectedListener(this);

            IMenuItem lFirstItem = lNavView.Menu.GetItem(0);

            if (lFirstItem != null)
            {
                OnNavigationItemSelected(lFirstItem);
                lFirstItem.SetChecked(true);
            }
        }
예제 #20
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Memes);
            Context context = Application.Context;

            ////////////////////////МЕНЮ\\\\\\\\\\\\\\\\\\\\\\
            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id._app_bar);

            SetSupportActionBar(toolbar);
            SupportActionBar.SetTitle(Resource.String.app_name);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);
            var navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.NavigationItemSelected += NavigationView_NavigationItemSelected;;
            var drawerToogle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.open_drawer, Resource.String.close_drawer);

            drawerLayout.AddDrawerListener(drawerToogle);
            drawerToogle.SyncState();
            ////////////////////////МЕНЮ\\\\\\\\\\\\\\\\\\\\\\

            string txtUrl = context.Resources.GetString(Resource.String.memesURL);

            webView = FindViewById <WebView>(Resource.Id.webView);
            webView.SetWebViewClient(new ExtendWebViewClient());


            WebSettings webSettings = webView.Settings;

            webSettings.JavaScriptEnabled = true;
            webView.LoadUrl(txtUrl);
        }
예제 #21
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);
            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;

            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.SetNavigationItemSelectedListener(this);

            Button whatsapp_btn = FindViewById <Button>(Resource.Id.whatsapp_btn);

            whatsapp_btn.Click += (o, e) =>
            {
                string phone_Number = "8818701389169";
                string message      = "Hallo";
                Console.WriteLine(message);
                StartActivity(new Intent(Intent.ActionView, Android.Net.Uri.Parse("https://api.whatsapp.com/send?phone=" + phone_Number + "&text=" + message)));
            };
        }
예제 #22
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_downloads);


            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            activeDownloads = new Dictionary <string, Torrent>();

            var prefs = PreferenceManager.GetDefaultSharedPreferences(this);

            hostname = prefs.GetString(key: "hostname", defValue: GetString(Resource.String.default_hostname));


            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.SetNavigationItemSelectedListener(this);

            swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.rootLayout);
            swipeRefreshLayout.SetColorSchemeColors(new int[] { Android.Resource.Color.BackgroundLight });
            swipeRefreshLayout.Refresh += this.SwipeRefreshLayout_Refresh;


            RequestTorrents();
        }
예제 #23
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            mToolbar        = FindViewById <SupportToolbar>(Resource.Id.app_bar);
            mDrawerLayout   = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            mNavigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            //Init Toolbar
            SetSupportActionBar(mToolbar);
            SupportActionBar.SetTitle(Resource.String.app_name);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);

            //Attach Item slected handler to nav view
            mNavigationView.NavigationItemSelected += NavigationView_NavigationItemSelected;

            //Create ActionBarDrawerToggle Button and add it to the toolbar
            var drawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, mToolbar, Resource.String.openDrawer, Resource.String.closeDrawer);

            mDrawerLayout.AddDrawerListener(drawerToggle);
            drawerToggle.SyncState();

            //This is where a default home screen would be loaded / check authentication ; whatever is decided
            //var ft = FragmentManager.BeginTransaction();
            //ft.Add(Resource.Id.HomeFrameLayout, new HomeFragment());
            //ft.Commit();
        }
예제 #24
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            DisplayImageOptions displayImageOptions = new DisplayImageOptions.Builder()
                                                      .CacheInMemory(false)
                                                      .ShowImageOnLoading(Resource.Drawable.main)
                                                      .ResetViewBeforeLoading(false)
                                                      .CacheOnDisk(false).Build();
            ImageLoaderConfiguration imagaeLoaderConfigurtaion = new ImageLoaderConfiguration.Builder(ApplicationContext)
                                                                 .DefaultDisplayImageOptions(displayImageOptions)
                                                                 .Build();

            ImageLoader.Instance.Init(imagaeLoaderConfigurtaion);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_navigation);
            mTts     = new TextToSpeech(this, this, "com.google.android.tts");
            mToolbar = FindViewById <SupportToolbar>(Resource.Id.toolbar);
            SetSupportActionBar(mToolbar);
            if (Intent.GetStringExtra("source") != null)
            {
                mSourceAddress = Intent.GetStringExtra("source");
            }
            typeface       = Typeface.CreateFromAsset(this.Assets, "JosefinSans-SemiBold.ttf");
            mLoadingDialog = new LoadingDialog(this, Resource.Drawable.main);
            mLoadingDialog.SetCancelable(false);
            Window window = mLoadingDialog.Window;

            window.SetLayout(WindowManagerLayoutParams.MatchParent, WindowManagerLayoutParams.MatchParent);
            window.SetBackgroundDrawable(new ColorDrawable(Resources.GetColor(Resource.Color.trans)));
            mSharedPreference      = GetSharedPreferences(Constants.MY_PREF, 0);
            mDrawerLayout          = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            mActionBarDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, mToolbar, Resource.String.openD, Resource.String.closedD);
            mDrawerLayout.AddDrawerListener(mActionBarDrawerToggle);
            mActionBarDrawerToggle.SyncState();
            mNavigationView = FindViewById <NavigationView>(Resource.Id.nav_view);
            mNavigationView.ItemIconTintList = null;
            mNavigationView.SetNavigationItemSelectedListener(this);
            View headerLayout = mNavigationView.GetHeaderView(0);

            mTextView = headerLayout.FindViewById <TextView>(Resource.Id.nametodisplay);
            mTextView.SetTypeface(typeface, TypefaceStyle.Normal);
            mTextView.Text = mSharedPreference.GetString("name", " ");
            if (bundle == null)
            {
                mFragment = new MapViewFragment(this);
                FragmentManager.BeginTransaction().Replace(Resource.Id.nav_frame, mFragment).Commit();
            }
            // handle deep link here
            var x = Intent;

            System.Diagnostics.Debug.WriteLine(x.Action);
            var nmLocaiton = "NO MEETING DATA FOUND";

            if (Intent.ActionView.Equals(x.Action))
            {
                var uri = x.Data;
                nmLocaiton = uri.GetQueryParameter("nmlocation");
            }
            System.Diagnostics.Debug.Write("Deep Link: " + nmLocaiton);
        }
예제 #25
0
		protected override void OnCreate(Bundle bundle)
		{
			base.OnCreate(bundle);

			setup();

			// Set our view from the "main" layout resource
			SetContentView(Resource.Layout.Main);

			drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
			drawerList = FindViewById<RecyclerView>(Resource.Id.left_drawer);

			drawerLayout.SetDrawerShadow(Resource.Drawable.drawer_shadow, GravityCompat.Start);
			drawerList.SetLayoutManager(new LinearLayoutManager(this));
			adapter = new MenuAdapter();
			drawerList.SetAdapter(adapter);

			// enable ActionBar app icon to behave as action to toggle nav drawer
			this.ActionBar.SetDisplayHomeAsUpEnabled(true);
			this.ActionBar.SetHomeButtonEnabled(true);
			this.ActionBar.Title = "Test";
			drawerToggle = new MainDrawerToggle(this, drawerLayout,
				Resource.Drawable.ic_drawer,
				Resource.String.drawer_open,
				Resource.String.drawer_close);

			drawerLayout.AddDrawerListener(drawerToggle);

			drawerLayout.CloseDrawer(drawerList);
			vm.NavigatedTo(null);
		}
예제 #26
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);
            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            //EnableSharing();

            //FloatingActionButton fabListen = FindViewById<FloatingActionButton>(Resource.Id.listen);
            FloatingActionButton fabSend = FindViewById <FloatingActionButton>(Resource.Id.send);
            //fabListen.Click += ActivateListening;
            //fabSend.Click += SendSignal;

            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.SetNavigationItemSelectedListener(this);
        }
예제 #27
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);

            // Set the content view
            SetContentView(Resource.Layout.activity_main);

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;

            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.SetNavigationItemSelectedListener(this);

            await ApplicationSetupAsync();
        }
예제 #28
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_main);
            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;

            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.SetNavigationItemSelectedListener(this);

            Button button1 = FindViewById <Button>(Resource.Id.button1);

            button1.Click += Button1_Click;
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);
            StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().PermitAll().Build();
            StrictMode.SetThreadPolicy(policy);
            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.SetNavigationItemSelectedListener(this);

            tabs      = FindViewById <TabLayout>(Resource.Id.tabs);
            viewPager = FindViewById <ViewPager>(Resource.Id.viewpager);
            SetUpProductViewPager(viewPager);
            tabs.SetupWithViewPager(viewPager);
        }
예제 #30
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);
            activity = this;

            toolbar = FindViewById <V7Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowTitleEnabled(false);
            SupportActionBar.SetHomeButtonEnabled(true);

            navigationView = FindViewById <NavigationView>(Resource.Id.navigation_view);
            drawerLayout   = FindViewById <DrawerLayout>(Resource.Id.navigation_drawer);

            toggle = new SmootherDrawerToggle(this, drawerLayout, toolbar, Resource.String.openDrawer, Resource.String.closeDrawer);
            drawerLayout.AddDrawerListener(toggle);
            toggle.SyncState();

            listview = FindViewById <ExpandableListView>(Resource.Id.nav_menu);

            mAdapter = new MenuAdapter(ApplicationContext, mainFileAndFolders, filesAndFolders, this);
            listview.SetAdapter(mAdapter);

            replaceFragment(runningFragment);
        }
예제 #31
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            /*
             * FloatingActionButton fab = FindViewById<FloatingActionButton>(Resource.Id.fab);
             * fab.Click += FabOnClick;
             */
            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.SetNavigationItemSelectedListener(this);

            buttonPrev      = FindViewById <Button>(Resource.Id.buttonPrev);
            buttonNext      = FindViewById <Button>(Resource.Id.buttonNext);
            textTitle       = FindViewById <TextView>(Resource.Id.textTitle);
            imageAndroid    = FindViewById <ImageView>(Resource.Id.imageAndroid);
            textDescription = FindViewById <TextView>(Resource.Id.textDescription);

            buttonPrev.Click += buttonPrev_Click;
            buttonNext.Click += buttonNext_Click;

            AndroidManager = new AndroidManager();
            AndroidManager.MoveFirst();
            UpdateUI();
        }
예제 #32
0
		protected override void OnCreate(Bundle bundle)
		{
			base.OnCreate(bundle);

			// Set our view from the "main" layout resource
			SetContentView(Resource.Layout.Main);

			drawerLayout = FindViewById<DrawerLayout>(Resource.Id.myDrawer);
			notebooks = FindViewById<ListView>(Resource.Id.notebooks);
			leftSideMenu = FindViewById<LinearLayout>(Resource.Id.leftSideMenu);
			addNoteButton = FindViewById<Button>(Resource.Id.addButton);
			notes = FindViewById<ListView>(Resource.Id.notes);
			menuButton = FindViewById<Button>(Resource.Id.menuButton);
			syncButton = FindViewById<Button>(Resource.Id.syncButton);
			addNotebookButton = FindViewById<Button>(Resource.Id.addNotebookButton);

			drawerToggle = new SideMenuDrawerToggle(this, drawerLayout, Resource.String.open_drawer, Resource.String.close_drawer);//Resource.Drawable.Icon, -- removed
			drawerLayout.AddDrawerListener(drawerToggle);
			drawerLayout.CloseDrawer(leftSideMenu);

			notebooksAdapter = new NotebooksAdapter(this);
			notebooks.Adapter = notebooksAdapter;
			chosenNotebookId = Guid.Parse(notebooksAdapter.GetItemAtPosition(0).Id);

			notesAdapter = new NotesAdapter(this, chosenNotebookId);
			notes.Adapter = notesAdapter;

			addNoteButton.Click += AddNoteButton_Click;

			menuButton.Click += MenuButton_Click;

			syncButton.Click += SyncButton_Click;

			addNotebookButton.Click += AddNotebookButton_Click;

			notebooks.ItemClick += Notebooks_ItemClick; ;

			notes.ItemClick += Notes_ItemClick;
		}