public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { base.OnCreateView(inflater, container, savedInstanceState); View view = inflater.Inflate(Resource.Layout.basic_fragment_get_help, null); addRequest = view.FindViewById <Button>(Resource.Id.btnAdd); Activity.Title = "Get Help"; ViewModel = new BrowseQuestionsViewModel(); recyclerView = view.FindViewById <RecyclerView>(Resource.Id.recyclerView); recyclerView.HasFixedSize = false; recyclerView.AddItemDecoration(new DividerItemDecoration(recyclerView.Context, DividerItemDecoration.Vertical)); recyclerView.SetAdapter(adapter = new MyCurrentRequestAdapter(Activity, this, ViewModel)); refresher = view.FindViewById <SwipeRefreshLayout>(Resource.Id.refresher); refresher.SetColorSchemeColors(Resource.Color.accent); addRequest.Click += (sender, e) => { FragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, BasicAskQuestionFragment.NewInstance()) .AddToBackStack(null).Commit(); }; return(view); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); ViewModel = new ItemsViewModel(); var recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); recyclerView.HasFixedSize = true; recyclerView.SetAdapter(adapter = new BrowseItemsAdapter(this, ViewModel)); refresher = FindViewById <SwipeRefreshLayout>(Resource.Id.refresher); refresher.SetColorSchemeColors(Resource.Color.accent); progress = FindViewById <ProgressBar>(Resource.Id.progressbar_loading); progress.Visibility = ViewStates.Gone; Toolbar.MenuItemClick += (sender, e) => { var intent = new Intent(this, typeof(AddItemActivity));; StartActivity(intent); }; SupportActionBar.SetDisplayHomeAsUpEnabled(false); SupportActionBar.SetHomeButtonEnabled(false); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { base.OnCreateView(inflater, container, savedInstanceState); View view = inflater.Inflate(Resource.Layout.basic_fragment_my_request_detail, null); Activity.Title = "My Request Detail"; ViewModel = new MyRequestDetailViewModel(Arguments.GetString("questionId")); questionTitle = view.FindViewById <TextView>(Resource.Id.text_question_title); questionBody = view.FindViewById <TextView>(Resource.Id.text_question_body); tags = view.FindViewById <TextView>(Resource.Id.text_question_tags); postedDate = view.FindViewById <TextView>(Resource.Id.text_posted_date); recyclerView = view.FindViewById <RecyclerView>(Resource.Id.recyclerView); recyclerView.HasFixedSize = false; recyclerView.SetAdapter(adapter = new HelpersAdapter(Activity, this, ViewModel)); refresher = view.FindViewById <SwipeRefreshLayout>(Resource.Id.refresher); refresher.SetColorSchemeColors(Resource.Color.accent); statusSpinner = view.FindViewById <Spinner>(Resource.Id.status_spinner); statusSpinner.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(Spinner_ItemSelected); spinnerAdapter = ArrayAdapter.CreateFromResource( Activity, Resource.Array.request_status_array, Resource.Layout.statusSpinnerLayout); spinnerAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); statusSpinner.Adapter = spinnerAdapter; //spinnerText = (TextView) statusSpinner.GetChildAt(0); return(view); }
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(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.PedidosFinalizadosLayout); Historiallist = FindViewById <ListView>(Resource.Id.historialpedidoslist); refreshLayout3 = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout3); // Create your application here ISharedPreferences preff = PreferenceManager.GetDefaultSharedPreferences(this); var jee = preff.GetString("Usuario", ""); string hist = string.Format("Select IdPedido, SUM(PrecioProducto) as Venta From TapFood.Pedido where(IdRestaurante= '{0}') group by IdPedido", jee.ToString()); MySqlCommand cmd = new MySqlCommand(hist, conn); MySqlDataReader read; read = cmd.ExecuteReader(); while (read.Read()) { HistorialPedidos historia = new HistorialPedidos(); historia.IdPedido = read["IdPedido"].ToString(); historia.Venta = (float)read["Venta"]; historial.Add(historia); } read.Close(); Historiallist.Adapter = new HistorialPedidosAdapter(this, historial); Historiallist.ChoiceMode = ChoiceMode.Single; Historiallist.ItemClick += Productslislv_ItemClick; refreshLayout3.SetColorSchemeColors(Color.Red, Color.Green, Color.Blue, Color.Yellow); refreshLayout3.Refresh += RefreshLayout_Refresh; }
protected override void InitViews() { llAdd = FindViewById <LinearLayout>(Resource.Id.ll_add); tvTeacherCount = FindViewById <TextView>(Resource.Id.tv_teachercount); mSwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.refresher); mRecyclerView = FindViewById <RecyclerView>(Resource.Id.recycler_view); mSwipeRefreshLayout.SetColorSchemeColors(Color.ParseColor("#db0000")); linearLayoutManager = new LinearLayoutManager(CurrActivity); mAdapter = new TeacherScopeAdapter(CurrContext, teachScopeList); mRecyclerView.SetLayoutManager(linearLayoutManager); mRecyclerView.SetAdapter(mAdapter); mAdapter.NotifyDataSetChanged(); mSwipeRefreshLayout.SetOnRefreshListener(this); //mSwipeRefreshLayout.SetOnScrollChangeListener(this); //mAdapter.SetOnItemClickListener(this); RecyclerViewItemOnGestureListener viewOnGestureListener = new RecyclerViewItemOnGestureListener(mRecyclerView, this); mRecyclerView.AddOnItemTouchListener(new RecyclerViewItemOnItemTouchListener(mRecyclerView, viewOnGestureListener)); }
/// <summary> /// 初始化页面控件 /// </summary> protected void InitViews(View view) { tv_year = view.FindViewById <TextView>(Resource.Id.tv_year); tv_district = view.FindViewById <TextView>(Resource.Id.tv_district); tv_title_payment = view.FindViewById <TextView>(Resource.Id.tv_title_payment); //添加按钮的事件监控 tv_year.SetOnClickListener(this); tv_district.SetOnClickListener(this); mRecyclerView = (RecyclerView)view.FindViewById(Resource.Id.recycler_view); //adapter展示列表数据 linearLayoutManager = new LinearLayoutManager(CurrActivity); mAdapter = new BudgeAdapter(CurrActivity, paymentList); mRecyclerView.SetLayoutManager(linearLayoutManager); mRecyclerView.SetAdapter(mAdapter); mAdapter.NotifyDataSetChanged(); RecyclerViewItemOnGestureListener viewOnGestureListener = new RecyclerViewItemOnGestureListener(mRecyclerView, this); mRecyclerView.AddOnItemTouchListener(new RecyclerViewItemOnItemTouchListener(mRecyclerView, viewOnGestureListener)); //搜索条件弹框 popYear = null; popDistrict = null; //初始化查询类型 dataType = 1; //下拉刷新 mSwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(Resource.Id.refresher); mSwipeRefreshLayout.SetColorSchemeColors(Color.ParseColor("#db0000")); mSwipeRefreshLayout.SetOnRefreshListener(this); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var view = inflater.Inflate(Resource.Layout.ListViewWithSwipe, container, false); SwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(Resource.Id.swipe_refresh_layout); SwipeRefreshLayout.SetColorSchemeColors(Resource.Color.tenBlue, Resource.Color.colorPrimary, Resource.Color.colorAccent, Resource.Color.colorPrimaryDark); SwipeRefreshLayout.Refresh += async delegate { await FetchTableData(); }; ListView = view.FindViewById<ListView>(Resource.Id.list); ListView.SetOnScrollListener(new TailFetchListViewListener(this)); ListView.AddFooterView(FooterView, null, false); ListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => { TenServiceHelper.GoToGuestProfile(FragmentManager, Master.Id, TableItems[e.Position]); }; BackgroundTextView = (TextView)view.FindViewById<TextView>(Resource.Id.backgroundTextView); BackgroundTextView.Text = EmptyTableString; return view; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); ThreadPool.QueueUserWorkItem(o => LoadUser()); SetContentView(Resource.Layout.activity_main); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); mSwipe = FindViewById <SwipeRefreshLayout>(Resource.Id.swipe_refresh); mSwipe.SetColorSchemeColors(Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloBlueDark, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloRedLight); mSwipe.Refresh += mSwipe_Refresh; 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.lvGallery); SearchView searchButton = FindViewById <SearchView>(Resource.Id.filterGallery); searchButton.SetQueryHint("Enter your filter query"); searchButton.QueryTextChange += (sender, e) => { ThreadPool.QueueUserWorkItem(o => GetGalleryImagesAsync(e.NewText)); }; ThreadPool.QueueUserWorkItem(o => GetGalleryImagesAsync(null)); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); ViewModel = new QuestionDetailViewModel(Intent.GetStringExtra("questionId")); title = FindViewById <TextView>(Resource.Id.question_view_item_title); answerCount = FindViewById <TextView>(Resource.Id.textAnswerCount); answerBtn = FindViewById <Button>(Resource.Id.btnAnswer); recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); recyclerView.HasFixedSize = false; recyclerView.AddItemDecoration(new DividerItemDecoration(recyclerView.Context, DividerItemDecoration.Vertical)); recyclerView.SetAdapter(adapter = new BrowseItemsAdapter(this, ViewModel)); refresher = FindViewById <SwipeRefreshLayout>(Resource.Id.refresher); refresher.SetColorSchemeColors(Resource.Color.accent); answerBtn.Click += (sender, e) => { var intent = new Intent(this, typeof(AnswerActivity)); intent.PutExtra("data", ViewModel.Question.ObjectId); StartActivity(intent); }; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); listitem = FindViewById <ListView>(Resource.Id.listView1); List <string> items = new List <string>(); items.Add("C#"); items.Add("ASP.NET"); items.Add("JAVA"); items.Add("MVC"); items.Add("Swift"); items.Add("JQuery"); items.Add("ASP"); items.Add("JSP"); items.Add("C"); items.Add("PHP"); items.Add("Ruby"); ArrayAdapter <string> liststring = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleExpandableListItem1, items); listitem.Adapter = liststring; refreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout); refreshLayout.SetColorSchemeColors(Color.Red, Color.Green, Color.Blue, Color.Yellow); refreshLayout.Refresh += RefreshLayout_Refresh; }
/// <summary> /// 初始化页面控件 /// </summary> protected void InitViews(View view) { tv_totalcount = view.FindViewById <TextView>(Resource.Id.tv_totalcount); tv_year = view.FindViewById <TextView>(Resource.Id.tv_year); tv_district = view.FindViewById <TextView>(Resource.Id.tv_district); tv_cagetory = view.FindViewById <TextView>(Resource.Id.tv_category); //添加按钮的事件监控 tv_year.SetOnClickListener(this); tv_district.SetOnClickListener(this); tv_cagetory.SetOnClickListener(this); mSwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(Resource.Id.refresher); mSwipeRefreshLayout.SetColorSchemeColors(Color.ParseColor("#db0000")); mSwipeRefreshLayout.SetOnRefreshListener(this); //adapter展示列表数据 linearLayoutManager = new LinearLayoutManager(CurrActivity); mRecyclerView = (RecyclerView)view.FindViewById(Resource.Id.recycler_view); mAdapter = new NewStudentAdapter(CurrActivity, sumList, this.avgGrowthRate, mRecyclerView); mRecyclerView.SetLayoutManager(linearLayoutManager); mRecyclerView.SetAdapter(mAdapter); mAdapter.NotifyDataSetChanged(); //搜索条件弹框 popYear = null; popCategory = null; popDistrict = null; //初始化查询类型 dataType = 1; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewModel = new BuildingsViewModel(); Context mContext = Android.App.Application.Context; AppPreferences ap = new AppPreferences(mContext); facilityId = Convert.ToInt32(ap.GetFacilityId()); View view = inflater.Inflate(Resource.Layout.fragment_facility_building, container, false); recyclerView = view.FindViewById <RecyclerView>(Resource.Id.buildingRecyclerView); addButton = view.FindViewById <FloatingActionButton>(Resource.Id.addnewBuilding_button); recyclerView.HasFixedSize = true; recyclerView.SetAdapter(adapter = new BrowseBuildingsAdapter(Activity, ViewModel)); refresher = view.FindViewById <SwipeRefreshLayout>(Resource.Id.buildingRefresher); refresher.SetColorSchemeColors(Resource.Color.accent); progress = view.FindViewById <ProgressBar>(Resource.Id.buildingprogressbar_loading); progress.Visibility = ViewStates.Gone; addButton.Click += AddButton_Click; addButton.SetBackgroundColor(Android.Graphics.Color.Tan); return(view); }
public override void OnViewCreated(View view, Bundle savedInstanceState) { base.OnViewCreated(view, savedInstanceState); scrollView = view.FindViewById <ScrollView>(Resource.Id.scrollView); recyclerView = view.FindViewById <RecyclerView>(Resource.Id.recyclerView); noContentTextView = view.FindViewById <TextView>(Resource.Id.noContent); fab = view.FindViewById <FloatingActionButton>(Resource.Id.fab); fab.AttachToRecyclerView(recyclerView); fab.Click += (s, e) => parentActivity.StartActivity(new Intent(Application.Context, typeof(UploadActivity))); swipeRefreshLayout = view.FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout); swipeRefreshLayout.SetColorSchemeColors(Color.IndianRed, Color.LimeGreen, Color.AliceBlue, Color.LightGoldenrodYellow); swipeRefreshLayout.Refresh += (s, e) => getPosts(0); ((ToolbarActivity)parentActivity).ToolBar.Click += (s, e) => scrollView.ScrollTo(0, 0); viewManager = new LinearLayoutManager(Context); var scrollListener = new EndlessScrollListener(viewManager); recyclerView.HasFixedSize = true; recyclerView.NestedScrollingEnabled = false; recyclerView.SetLayoutManager(viewManager); recyclerView.AddOnScrollListener(scrollListener); getPosts(0); //scrollListener.OnEndReach += (e) => getPosts(e); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { base.OnCreateView(inflater, container, savedInstanceState); View view = inflater.Inflate(Resource.Layout.basic_fragment_browse_questions, null); Activity.Title = "Find Tasks"; ViewModel = new BrowseQuestionsViewModel(); recyclerView = view.FindViewById <RecyclerView>(Resource.Id.recyclerView); recyclerView.HasFixedSize = false; recyclerView.SetAdapter(adapter = new BrowseQuestionsAdapter(Activity, this, ViewModel)); refresher = view.FindViewById <SwipeRefreshLayout>(Resource.Id.refresher); refresher.SetColorSchemeColors(Resource.Color.accent); progress = view.FindViewById <ProgressBar>(Resource.Id.progressbar_loading); progress.Visibility = ViewStates.Gone; filterSpinner = view.FindViewById <Spinner>(Resource.Id.filter_spinner); filterSpinner.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinner_ItemSelected); var spinnerAdapter = ArrayAdapter.CreateFromResource( Activity, Resource.Array.opportunity_spinner_array, Resource.Layout.spinnerLayout); spinnerAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); filterSpinner.Adapter = spinnerAdapter; return(view); }
/// <summary> /// 初始化页面控件 /// </summary> protected override void InitViews() { tv_grade = FindViewById <TextView>(Resource.Id.tv_grade); tv_course = FindViewById <TextView>(Resource.Id.tv_course); tv_title = FindViewById <TextView>(Resource.Id.tv_title); tv_itemTitle = FindViewById <TextView>(Resource.Id.tv_item_title); tv_title.Text = areaName; if (dataType == 1) { tv_itemTitle.Text = "总人次"; } else { tv_itemTitle.Text = "总收入"; } mRecyclerView = (RecyclerView)FindViewById(Resource.Id.recycler_view); //adapter展示列表数据 linearLayoutManager = new LinearLayoutManager(CurrActivity); mAdapter = new SumByTeacherAdapter(CurrContext, sumTeacherList); mRecyclerView.SetLayoutManager(linearLayoutManager); mRecyclerView.SetAdapter(mAdapter); mAdapter.NotifyDataSetChanged(); RecyclerViewItemOnGestureListener viewOnGestureListener = new RecyclerViewItemOnGestureListener(mRecyclerView, this); mRecyclerView.AddOnItemTouchListener(new RecyclerViewItemOnItemTouchListener(mRecyclerView, viewOnGestureListener)); //下拉刷新 mSwipeRefreshLayout = (SwipeRefreshLayout)FindViewById(Resource.Id.refresher); mSwipeRefreshLayout.SetColorSchemeColors(Color.ParseColor("#db0000")); mSwipeRefreshLayout.SetOnRefreshListener(this); }
public ManageWalletsActivity() : base(Resource.Layout.manage_wallet_layout) { OnLoaded += async delegate { // AllowBackNavigation(); createOnly = Intent.GetBooleanExtra("createOnly", false); // FindViewById <FloatingActionButton>(Resource.Id.fab_add_wallet).Click += OnAddWallet; listView = FindViewById <ListView>(Resource.Id.wallets_listview); emptyFrame = FindViewById <ViewGroup>(Resource.Id.empty_frame); // itemsAdapter = new SmartAdapter <WalletInfo>(this, Resource.Layout.user_wallet_item_layout, ViewHolders.ItemHolders.WalletItemBindings); listView.Adapter = itemsAdapter; // swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipe_refresh_root); swipeRefreshLayout.SetColorSchemeColors(AvatarDisplay.DefaultColors.Take(4).Select(t => t.ToArgb()).ToArray()); swipeRefreshLayout.Refresh += async delegate { await RefreshView(); }; // AddWalletDialogFragment.OnCreated += OnWalletCreated; AddWalletDialogFragment.OnUpdated += OnWalletUpdate; ViewHolders.ItemHolders.OnWalletRemoved += OnWalletRemoved; await RefreshView(false, true); }; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { _cars = new List <Tuple <string, string, string, string, Uri, string> >(); // Use this to return your custom view for this Fragment var view = inflater.Inflate(Resource.Layout.homepage_fragment, container, false); //get the elements _vehicleListView = view.FindViewById <ListView>(Resource.Id.vehicleListView); _refresher = view.FindViewById <SwipeRefreshLayout>(Resource.Id.refresher); _btnRequest = view.FindViewById <Button>(Resource.Id.btnRequest); _btnMessage = view.FindViewById <Button>(Resource.Id.btnMessage); _btnSell = view.FindViewById <Button>(Resource.Id.btnSell); _vehicleListView.FastScrollEnabled = true; _vehicleListView.FastScrollAlwaysVisible = false; //vehicleListView.Fling(500); //assign click actions to the buttons _vehicleListView.ItemClick += VehicleListViewItemClick; _btnRequest.Click += BtnRequestClick; _btnMessage.Click += BtnMessageClick; _btnSell.Click += BtnSellClick; //add click functions and other properties for pull down to refresh _refresher.SetColorSchemeColors( Resource.Color.ltyellow, Resource.Color.accent, Resource.Color.appBackground, Resource.Color.ltyellow); _refresher.Refresh += HandleViewRefresh; return(view); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); var data = Intent.GetStringExtra("data"); var item = Newtonsoft.Json.JsonConvert.DeserializeObject <Thread>(data); // viewModel = new TextMessagesViewModel(this.ContentResolver, item.ThreadId); var recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); recyclerView.HasFixedSize = true; recyclerView.SetAdapter(adapter = new TextMessageItemsAdapter(this, viewModel)); var layoutManager = (GridLayoutManager)recyclerView.GetLayoutManager(); layoutManager.ReverseLayout = true; //layoutManager.StackFromEnd = true; recyclerView.SetLayoutManager(layoutManager); refresher = FindViewById <SwipeRefreshLayout>(Resource.Id.refresher); refresher.SetColorSchemeColors(Resource.Color.accent); progress = FindViewById <ProgressBar>(Resource.Id.progressbar_loading); progress.Visibility = ViewStates.Gone; // SupportActionBar.Title = item.PhoneContact?.DisplayName; SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetBackgroundDrawable(new ColorDrawable(Color.ParseColor("#2196F3"))); }
/// <summary> /// 页面控件 /// </summary> protected void InitViews(View view) { tv_btn1 = view.FindViewById <TextView>(Resource.Id.tv_btn1); tv_btn2 = view.FindViewById <TextView>(Resource.Id.tv_btn2); tv_btn3 = view.FindViewById <TextView>(Resource.Id.tv_btn3); tv_btn1.SetOnClickListener(this); tv_btn2.SetOnClickListener(this); tv_btn3.SetOnClickListener(this); mSwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(Resource.Id.refresher); mRecyclerView = (RecyclerView)view.FindViewById(Resource.Id.recycler_view); mSwipeRefreshLayout.SetColorSchemeColors(Color.ParseColor("#db0000")); //mSwipeRefreshLayout.SetColorScheme(Resource.Color.xam_dark_blue, //Resource.Color.xam_purple, //Resource.Color.xam_gray, //Resource.Color.xam_green); linearLayoutManager = new LinearLayoutManager(CurrActivity); mAdapter = new RenewReportAdapter(CurrActivity, teachReportList); mRecyclerView.SetLayoutManager(linearLayoutManager); mRecyclerView.SetAdapter(mAdapter); mAdapter.NotifyDataSetChanged(); mSwipeRefreshLayout.SetOnRefreshListener(this); RecyclerViewItemOnGestureListener viewOnGestureListener = new RecyclerViewItemOnGestureListener(mRecyclerView, this); mRecyclerView.AddOnItemTouchListener(new RecyclerViewItemOnItemTouchListener(mRecyclerView, viewOnGestureListener)); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); listitem = FindViewById <ListView>(Resource.Id.listView1); List <string> items = new List <string>(); items.Add("California"); items.Add("Denver"); items.Add("Houston"); items.Add("Boston"); items.Add("New York"); items.Add("San Jose"); items.Add("Virginia"); items.Add("Austin"); items.Add("San Fernando"); items.Add("North Carolina"); items.Add("Ruby"); ArrayAdapter <string> liststring = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleExpandableListItem1, items); listitem.Adapter = liststring; refreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout); refreshLayout.SetColorSchemeColors(Color.Red, Color.Green, Color.Blue, Color.Yellow); refreshLayout.Refresh += RefreshLayout_Refresh; }
protected override void InitViews() { FindViewById <TextView>(Resource.Id.tv_title).Text = string.Format("{0}教学报表", currReportInfo.Item3); tv_btn1 = FindViewById <TextView>(Resource.Id.tv_btn1); tv_btn2 = FindViewById <TextView>(Resource.Id.tv_btn2); tv_btn3 = FindViewById <TextView>(Resource.Id.tv_btn3); mSwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.refresher); mRecyclerView = FindViewById <RecyclerView>(Resource.Id.recycler_view); mSwipeRefreshLayout.SetColorSchemeColors(Color.ParseColor("#db0000")); linearLayoutManager = new LinearLayoutManager(CurrActivity); mAdapter = new RenewReportAdapter(CurrContext, teachReportList); mRecyclerView.SetLayoutManager(linearLayoutManager); mRecyclerView.SetAdapter(mAdapter); mAdapter.NotifyDataSetChanged(); mSwipeRefreshLayout.SetOnRefreshListener(this); //mSwipeRefreshLayout.SetOnScrollChangeListener(this); //mAdapter.SetOnItemClickListener(this); RecyclerViewItemOnGestureListener viewOnGestureListener = new RecyclerViewItemOnGestureListener(mRecyclerView, this); mRecyclerView.AddOnItemTouchListener(new RecyclerViewItemOnItemTouchListener(mRecyclerView, viewOnGestureListener)); arrowDown = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.arrow_down); arrowDownOn = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.arrow_down_on); SetClassStatusImg(FindViewById <ImageButton>(Resource.Id.imgBtn_lessonIng), "init"); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.movie_category_list, container, false); if (_onRefresh != null) { _refresher = view.FindViewById <SwipeRefreshLayout>(Resource.Id.refresher); _refresher.SetColorSchemeColors(Resource.Color.accent); } Refreshing(true); //TODO: see if I need this in detail page _progress = view.FindViewById <ProgressBar>(Resource.Id.progressbar_frame_container); _progress.Visibility = ViewStates.Visible; var recyclerView = view.FindViewById <RecyclerView>(Resource.Id.recyclerView); recyclerView.HasFixedSize = true; recyclerView.SetAdapter(_adapter); _progress.Visibility = ViewStates.Gone; Refreshing(false); return(view); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewModel = new FacilitiesViewModel(); ap = new AppPreferences(Application.Context); this.SqlLiteManager = new SqlLiteManager(); userId = Convert.ToInt32(ap.GetUserId()); View view = inflater.Inflate(Resource.Layout.fragment_facility, container, false); recyclerView = view.FindViewById <RecyclerView>(Resource.Id.facilityRecyclerView); searchedTxt = view.FindViewById <EditText>(Resource.Id.searchedTxt); searchedTxt.TextChanged += Search_Facilities; recyclerView.HasFixedSize = true; recyclerView.SetAdapter(adapter = new BrowseFacilitiesAdapter(Activity, ViewModel, userId)); refresher = view.FindViewById <SwipeRefreshLayout>(Resource.Id.refresher); refresher.SetColorSchemeColors(Resource.Color.accent); progress = view.FindViewById <ProgressBar>(Resource.Id.progressbar_loading); progress.Visibility = ViewStates.Gone; return(view); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); #if DEBUG Xamarin.Insights.Initialize("ef02f98fd6fb47ce8624862ab7625b933b6fb21d", this); #else Xamarin.Insights.Initialize("8da86f8b3300aa58f3dc9bbef455d0427bb29086", this); #endif mapView = FindViewById <MapView> (Resource.Id.map); mapView.OnCreate(bundle); mapView.Visibility = ViewStates.Invisible; viewModel = new CoffeeFilterViewModel(); ServiceContainer.Register <CoffeeFilterViewModel> (viewModel); adapter = new PlacesPagerAdapter(SupportFragmentManager, viewModel); pager = FindViewById <ViewPager> (Resource.Id.pager); pager.Adapter = adapter; progressBar = FindViewById <ImageView> (Resource.Id.progressBar); errorImage = FindViewById <ImageView> (Resource.Id.error); coffeeProgress = (AnimationDrawable)progressBar.Background; progressBar.Visibility = ViewStates.Gone; pager.PageSelected += (sender, e) => UpdateMap(e.Position); pager.PageScrollStateChanged += (sender, e) => { if (e.State == (int)ScrollState.TouchScroll) { refresher.Enabled = false; } else { refresher.Enabled = true; } }; refresher = FindViewById <SwipeRefreshLayout> (Resource.Id.refresher); refresher.SetColorSchemeColors(Resource.Color.accent); refresher.Refresh += (sender, args) => { RefreshData(true); refresher.PostDelayed(() => { refresher.Refreshing = false; }, 250); }; SupportActionBar.SetDisplayHomeAsUpEnabled(false); SupportActionBar.SetHomeButtonEnabled(false); mapView.GetMapAsync(this); CheckGooglePlayServices(); // No savedInstanceState, so it is the first launch of this activity if (bundle == null && AppInviteReferral.HasReferral(Intent)) { // In this case the referral data is in the intent launching the MainActivity, // which means this user already had the app installed. We do not have to // register the Broadcast Receiver to listen for Play Store Install information LaunchDeepLinkActivity(Intent); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here StatusBarUtil.SetColorStatusBars(this); SetToolBarNavBack(); shareWidget = new UMengShareWidget(this); wb_content = FindViewById <WebView>(Resource.Id.wb_content); tv_ding = FindViewById <TextView>(Resource.Id.tv_ding); btn_mark = FindViewById <Button>(Resource.Id.btn_mark); btn_comment = FindViewById <Button>(Resource.Id.btn_comment); tv_view = FindViewById <TextView>(Resource.Id.tv_view); swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout); swipeRefreshLayout.SetColorSchemeColors(Resources.GetColor(Resource.Color.primary)); swipeRefreshLayout.SetOnRefreshListener(this); btn_mark.Click += (s, e) => { AddBookmarkActivity.Enter(this, string.Format(Constact.KbPage, ID), news.Title, "add"); }; btn_comment.Click += (s, e) => { NewsCommentActivity.Enter(this, ID); }; wb_content.Settings.DomStorageEnabled = true; wb_content.Settings.JavaScriptEnabled = true; //支持js wb_content.Settings.DefaultTextEncodingName = "utf-8"; //设置编码方式utf-8 wb_content.Settings.SetSupportZoom(false); //不可缩放 wb_content.Settings.DisplayZoomControls = false; //隐藏原生的缩放控件 wb_content.Settings.BuiltInZoomControls = false; //设置内置的缩放控件 wb_content.Settings.CacheMode = CacheModes.CacheElseNetwork; wb_content.ScrollBarStyle = ScrollbarStyles.InsideOverlay; wb_content.Settings.LoadsImagesAutomatically = true; //支持自动加载图片 wb_content.Settings.UseWideViewPort = true; //将图片调整到合适webview的大小 wb_content.Settings.SetLayoutAlgorithm(WebSettings.LayoutAlgorithm.SingleColumn); var jsInterface = new WebViewJSInterface(this); wb_content.SetWebViewClient(ContentWebViewClient.Instance(this)); wb_content.AddJavascriptInterface(jsInterface, "openlistner"); jsInterface.CallFromPageReceived += delegate(object sender, WebViewJSInterface.CallFromPageReceivedEventArgs e) { PhotoActivity.Enter(this, e.Result.Split(','), e.Index); }; ID = Intent.GetIntExtra("id", 0); if (ID == 0) { Android.OS.Handler handle = new Android.OS.Handler(); handle.PostDelayed(() => { Finish(); }, 2000); AlertUtil.ToastShort(this, "获取id错误立即返回"); } InitNews(); //shareWidget = new UMengShareWidget(this); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.pedidoslayout); list = FindViewById <ListView>(Resource.Id.pedidoslist); refreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout); ISharedPreferences preff = PreferenceManager.GetDefaultSharedPreferences(this); var jee = preff.GetString("Usuario", ""); string prev = string.Format("Select IdPedido, GROUP_CONCAT(Confirmada Order by Confirmada desc SEPARATOR ' ') as Resolucion from TapFood.Pedido where (Recolectada ='NO' and IdRestaurante = '{0}') group by IdPedido;", jee.ToString()); //string prev = string.Format("select * from TapFood.Pedido where IdRestaurante='{0}'", jee.ToString()); MySqlCommand fff = new MySqlCommand(prev, conn); MySqlDataReader ccc; ccc = fff.ExecuteReader(); while (ccc.Read()) { Pedidosadap pedido = new Pedidosadap(); /*pedido.irrelevante = Convert.ToInt32(ccc["irrelevante"].ToString()); * pedido.IdPedido = ccc["IdPedido"].ToString(); * pedido.IdUsuario = ccc["IdUsuario"].ToString(); * pedido.NombreUsuario = ccc["NombreUsuario"].ToString(); * pedido.IdRestaurante = ccc["IdRestaurante"].ToString(); * pedido.IdProducto = ccc["IdProducto"].ToString(); * pedido.NombreProducto = ccc["NombreProducto"].ToString(); * pedido.PrecioProducto = (float)Convert.ToDouble(ccc["PrecioProducto"].ToString()); * pedido.Cantidad = Convert.ToInt32(ccc["Cantidad"].ToString()); * pedido.IdRepartidor = ccc["IdRepartidor"].ToString(); * pedido.NombreRepartidor = ccc["NombreRepartidor"].ToString(); * pedido.TipoDePago = ccc["TipoDePago"].ToString(); * pedido.LongitudPlaza = Convert.ToDouble(ccc["LongitudPlaza"].ToString()); * pedido.LatitudPlaza = Convert.ToDouble(ccc["LatitudPlaza"].ToString()); * pedido.LongitudUsuario = Convert.ToDouble(ccc["LongitudUsuario"].ToString()); * pedido.LatitudUsuario = Convert.ToDouble(ccc["LatitudUsuario"].ToString()); * pedido.Creada = ccc["Creada"].ToString(); * pedido.Confirmada = ccc["Confirmada"].ToString(); * pedido.Recolectada = ccc["Recolectada"].ToString(); * pedido.Entregada = ccc["Entregada"].ToString();*/ pedido.IdPedido = ccc["IdPedido"].ToString(); pedido.Resolucion = ccc["Resolucion"].ToString(); pedidos.Add(pedido); } ccc.Close(); list.Adapter = new pedidosgridadapter(this, pedidos); list.ChoiceMode = ChoiceMode.Single; //list.ItemSelected += List_ItemSelected; list.ItemClick += List_ItemClick; refreshLayout.SetColorSchemeColors(Color.Red, Color.Green, Color.Blue, Color.Yellow); refreshLayout.Refresh += RefreshLayout_Refresh; }
void UpdateRefreshColor() { var listViewEx = Element as ListViewEx; var color = listViewEx.RefreshColor; if (color != Color.Default) { RefreshLayout.SetColorSchemeColors(color.ToAndroid()); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); mSwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeLayout); mSwipeRefreshLayout.SetColorSchemeColors(Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloBlueDark, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloRedLight); mSwipeRefreshLayout.Refresh += mSwipeRefreshLayout_Refresh; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.overview); //ActionBar.Hide(); if (Intent.Extras != null && Intent.Extras.ContainsKey(PassWebsiteKey)) { currentWebsite = Config.GetWebsite(currentWebsiteKey = Intent.Extras.GetString(PassWebsiteKey)); } browsingContext = OverviewType.IndexPage; analysisModule.ReadIndexPage(UidGenerator(), currentWebsiteKey, refreshingLink = currentWebsite.IndexPageLink, this); //make the request ChangeStatusBarColor(Window, currentWebsite.Color); toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.overviewToolbar); appBarLayout = FindViewById <AppBarLayout>(Resource.Id.overviewAppbar); toolbar.SetBackgroundColor(Android.Graphics.Color.ParseColor(currentWebsite.Color)); appBarLayout.SetBackgroundColor(Android.Graphics.Color.ParseColor(currentWebsite.Color)); toolbar.Title = currentWebsite.Name; swipeRefLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swiperefresh); swipeRefLayout.Refresh += SwipeRefLayout_Refresh; swipeRefLayout.SetColorSchemeColors(new int[] { Android.Graphics.Color.ParseColor(currentWebsite.Color).ToArgb() }); drawerLayout = FindViewById <DrawerLayout>(Resource.Id.overviewDrawerLayout); navListview = FindViewById <ListView>(Resource.Id.navigationDrawerListView); navData = new string[currentWebsite.Categories.Length]; int index = 0; foreach (var item in currentWebsite.Categories) { navData[index++] = item.Name; } navAdapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, navData); navListview.Adapter = navAdapter; navListview.ItemClick += NavListview_ItemClick; recyView = FindViewById <RecyclerView>(Resource.Id.overviewRecyclerView); recyView.SetLayoutManager(recyLayoutManager = new LinearLayoutManager(this, (int)Orientation.Vertical, false)); recyView.SetAdapter(adapter = new RecyclerViewAdpater(currentWebsite)); adapter.OnItemClick += RecyclerView_OnItemClick; adapter.LoadNextPage += (sender, e) => LoadNextPage(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.CommentLayout); post_id = Intent.GetStringExtra("post_id"); Toolbar toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetActionBar(toolbar); ActionBar.Title = Intent.GetStringExtra("Titulo"); ActionBar.SetDisplayHomeAsUpEnabled(true); DashboardController = new EscritorioController(); post = DashboardController.GetSinglePost(post_id); FillPost(); svComentarios = FindViewById <ScrollView>(Resource.Id.svComentarios); tlComentarios = FindViewById <TableLayout>(Resource.Id.comment_table); comentarios = DashboardController.GetComentariosPost(post_id, localStorage.Get("Usuario_Id"), localStorage.Get("Usuario_Tipo"), page, sizePage); if (Convert.ToInt32(Intent.GetStringExtra("comments_total")) > 0) { tlComentarios.RemoveAllViews(); FillComments(); } SwipeRefreshLayout refresher = FindViewById <SwipeRefreshLayout>(Resource.Id.swipe_container); refresher.SetColorSchemeColors(Color.Gray, Color.LightGray, Color.Gray, Color.DarkGray, Color.Black, Color.DarkGray); refresher.Refresh += (sender, e) => { comentarios = DashboardController.GetComentariosPost(post_id, localStorage.Get("Usuario_Id"), localStorage.Get("Usuario_Tipo"), page, sizePage); if (comentarios.Count != 0) { tlComentarios.RemoveAllViews(); FillComments(); } ((SwipeRefreshLayout)sender).Refreshing = false; }; svComentarios.ScrollChange += (sender, e) => { if ((comentarios.Count / (page + 1)) < sizePage - 1) { if ((((ScrollView)sender).ScrollY / (page + 1)) > ((svComentarios.Height) * .4)) { ++page; FillComments(); } } }; }
protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); #if DEBUG Xamarin.Insights.Initialize("ef02f98fd6fb47ce8624862ab7625b933b6fb21d", this); #else Xamarin.Insights.Initialize ("8da86f8b3300aa58f3dc9bbef455d0427bb29086", this); #endif mapView = FindViewById<MapView> (Resource.Id.map); mapView.OnCreate (bundle); mapView.Visibility = ViewStates.Invisible; viewModel = new CoffeeFilterViewModel (); ServiceContainer.Register<CoffeeFilterViewModel> (viewModel); adapter = new PlacesPagerAdapter (SupportFragmentManager, viewModel); pager = FindViewById<ViewPager> (Resource.Id.pager); pager.Adapter = adapter; progressBar = FindViewById<ImageView> (Resource.Id.progressBar); errorImage = FindViewById<ImageView> (Resource.Id.error); coffeeProgress = (AnimationDrawable)progressBar.Background; progressBar.Visibility = ViewStates.Gone; pager.PageSelected += (sender, e) => UpdateMap (e.Position); pager.PageScrollStateChanged += (sender, e) => { if (e.State == (int)ScrollState.TouchScroll) refresher.Enabled = false; else refresher.Enabled = true; }; refresher = FindViewById<SwipeRefreshLayout> (Resource.Id.refresher); refresher.SetColorSchemeColors (Resource.Color.accent); refresher.Refresh += (sender, args) => { RefreshData (true); refresher.PostDelayed (() => { refresher.Refreshing = false; }, 250); }; SupportActionBar.SetDisplayHomeAsUpEnabled (false); SupportActionBar.SetHomeButtonEnabled (false); mapView.GetMapAsync (this); CheckGooglePlayServices (); // No savedInstanceState, so it is the first launch of this activity if (bundle == null && AppInviteReferral.HasReferral(Intent)) { // In this case the referral data is in the intent launching the MainActivity, // which means this user already had the app installed. We do not have to // register the Broadcast Receiver to listen for Play Store Install information LaunchDeepLinkActivity(Intent); } }