protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.adiBet); mAdView = FindViewById <AdView>(Resource.Id.adView); var adRequest = new AdRequest.Builder().Build(); mAdView.LoadAd(adRequest); myWebClient = new WebClient(); myWebClient.myOnProgressChanged += (int state) => { if (state == 0) { //(sender as SwipeRefreshLayout).Refreshing = false; myswipeRefreshLayout.Refreshing = false; //page loaded no progress bar visible //myProgressBar.Visibility = ViewStates.Invisible; } else { //(sender as SwipeRefreshLayout).Refreshing = true; myswipeRefreshLayout.Refreshing = true; //myProgressBar.Visibility = ViewStates.Visible; } }; myWebView = FindViewById <WebView>(Resource.Id.webView); myProgressBar = FindViewById <ProgressBar>(Resource.Id.progressBar); myswipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.refresher); myswipeRefreshLayout.SetColorScheme(Resource.Color.Red, Resource.Color.Orange, Resource.Color.Yellow, Resource.Color.Green, Resource.Color.Blue, Resource.Color.Indigo, Resource.Color.Violet); var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); myWebView.Settings.JavaScriptEnabled = true; myWebView.Settings.DisplayZoomControls = true; myWebView.Settings.BuiltInZoomControls = true; myWebView.LoadUrl("http://www.bestbet.tips"); myWebView.SetWebViewClient(myWebClient); //Toolbar will now take on default actionbar characteristics SetSupportActionBar(toolbar); SupportActionBar.Title = "BESTBET PREDICTIONS"; SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); myWebView.SetWebViewClient(myWebClient); myswipeRefreshLayout.Refresh += MyswipeRefreshLayout_Refresh; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var root = inflater.Inflate(Resource.Layout.fragment_contacts, container, false); refresher = root.FindViewById<SwipeRefreshLayout>(Resource.Id.refresher); refresher.SetColorScheme(Resource.Color.blue); refresher.Refresh += async delegate { if (viewModel.IsBusy) return; await viewModel.GetContactsAsync(); Activity.RunOnUiThread(() => { ((BaseAdapter)listView.Adapter).NotifyDataSetChanged(); }); }; viewModel.PropertyChanged += PropertyChanged; listView = root.FindViewById<ListView>(Resource.Id.list); listView.Adapter = new ContactAdapter(Activity, viewModel); listView.ItemLongClick += ListViewItemLongClick; listView.ItemClick += ListViewItemClick; var fab = root.FindViewById<FloatingActionButton>(Resource.Id.fab); fab.AttachToListView(listView); fab.Click += (sender, args) => { ContactDetailsActivity.ViewModel = null; var intent = new Intent(Activity, typeof(ContactDetailsActivity)); StartActivity(intent); }; return root; }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here StatusBarUtil.SetColorStatusBars(this); ImageLoaderConfiguration configuration = new ImageLoaderConfiguration.Builder(this).WriteDebugLogs().Build();//³õʼ»¯Í¼Æ¬¼ÓÔØ¿ò¼Ü ImageLoader.Instance.Init(configuration); //ÏÔʾͼƬÅäÖà options = new DisplayImageOptions.Builder() .ShowImageForEmptyUri(Resource.Drawable.icon_yuanyou) .ShowImageOnFail(Resource.Drawable.icon_yuanyou) .ShowImageOnLoading(Resource.Drawable.icon_user) .CacheInMemory(true) .BitmapConfig(Bitmap.Config.Rgb565) .CacheOnDisk(true) // .Displayer(new DisplayerImageCircle(20)) .Build(); SetToolBarNavBack(); _swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout); _swipeRefreshLayout.SetColorScheme(Resource.Color.primary); tv_dateAdded = FindViewById <TextView>(Resource.Id.tv_dateAdded); tv_userDisplayName = FindViewById <TextView>(Resource.Id.tv_userDisplayName); iv_userIcon = FindViewById <ImageView>(Resource.Id.iv_userIcon); tv_content = FindViewById <TextView>(Resource.Id.tv_content); edit_content = FindViewById <EditText>(Resource.Id.edit_content); btn_submit = FindViewById <Button>(Resource.Id.btn_submit); btn_submit.Click += AddCommentClick; statusId = Intent.GetIntExtra("id", 0); GetClientStatus(statusId); shareWidget = new UMengShareWidget(this); _recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); _recyclerView.SetLayoutManager(new LinearLayoutManager(this)); _swipeRefreshLayout.Post(() => { _swipeRefreshLayout.Refreshing = true; }); _swipeRefreshLayout.Refresh += async(s, e) => { await StatusService.ListStatusComment(AccessTokenUtil.GetToken(this), statusId, callBackSuccess, callBackError); }; edit_content.TextChanged += (s, e) => { if (string.IsNullOrEmpty(edit_content.Text.Trim())) { btn_submit.Enabled = false; } else { btn_submit.Enabled = true; } }; AlertUtil.ToastShort(this, "Ïß³ÌID" + System.Threading.Thread.CurrentThread.ManagedThreadId.ToString()); await StatusService.ListStatusComment(AccessTokenUtil.GetToken(this), statusId, callBackSuccess, callBackError); _recyclerView.AddItemDecoration(new RecyclerViewDecoration(this, (int)Orientation.Vertical)); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeLayout); swipeRefreshLayout.SetColorScheme(Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloBlueDark, Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloRedLight); // run this event if the view is pull down swipeRefreshLayout.Refresh += mSwipeRefreshLayout_Refresh; }
async private void Launch() { await Task.Delay(3000); SetContentView(Resource.Layout.Main); swipeLayout = FindViewById <SwipeRefreshLayout> (Resource.Id.swipe_container); swipeLayout.SetColorScheme(Resource.Color.Orange, Resource.Color.Blue, Resource.Color.Black, Resource.Color.Tomatoes); swipeLayout.Refresh += HandleRefresh; InitListView(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); forum = PostListFragment.Instantiate("android", "Android"); SupportFragmentManager.BeginTransaction() .Add(Resource.Id.container, forum, "post-list") .Commit(); refresher = FindViewById <SwipeRefreshLayout> (Resource.Id.refresher); refresher.SetColorScheme(Resource.Color.xam_dark_blue, Resource.Color.xam_purple, Resource.Color.xam_gray, Resource.Color.xam_green); refresher.Refresh += HandleRefresh; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.DiagnoseList); swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout); //Android 5.0需要使用这个过时的函数,SetColorSchemeColors无效。 swipeRefreshLayout.SetColorScheme(Android.Resource.Color.HoloRedLight); //下拉刷新 swipeRefreshLayout.Refresh += (s, e) => RefreshStudyList(); MyAdapter = new PatientListAdapter(this, MyStudyList.StudyList); LsvStudy = FindViewById <ListView>(Resource.Id.lsvStudy); LsvStudy.Adapter = MyAdapter; LsvStudy.ItemClick += LsvStudy_ItemClick; }
protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); SetContentView (Resource.Layout.Main); forum = PostListFragment.Instantiate ("android", "Android"); SupportFragmentManager.BeginTransaction () .Add (Resource.Id.container, forum, "post-list") .Commit (); refresher = FindViewById<SwipeRefreshLayout> (Resource.Id.refresher); refresher.SetColorScheme (Resource.Color.xam_dark_blue, Resource.Color.xam_purple, Resource.Color.xam_gray, Resource.Color.xam_green); refresher.Refresh += HandleRefresh; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_main); _swipeRefresh = FindViewById <SwipeRefreshLayout>(Resource.Id.swipe_main); _swipeRefresh.SetColorScheme(Resource.Color.colorPrimary, Android.Resource.Color.HoloGreenDark, Android.Resource.Color.HoloBlueDark, Android.Resource.Color.HoloOrangeDark); _swipeRefresh.SetOnRefreshListener(this); _swipeRefresh.Post(() => { SeedData(); }); _recyclerView = FindViewById <RecyclerView>(Resource.Id.recycler_waifu); _recyclerView.HasFixedSize = true; gridLayoutManager = new GridLayoutManager(this, 2); _recyclerView.SetLayoutManager(gridLayoutManager); _recyclerView.AddOnScrollListener(new LoadMoreListener(this)); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); intent1 = new Intent(this, typeof(Activity1)); parser = new RSSparser(); articles = new List <Article>(); items = new string[10]; news = new string[10]; toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetActionBar(toolbar); ActionBar.Title = ""; list = FindViewById <ListView>(Resource.Id.List); list.ItemClick += (sender, e) => { //SyndicationItem it; var it = news[e.Position]; var t = items[e.Position]; index = e.Position; intent1.PutExtra("index", news[e.Position]); StartActivity(intent1); }; //list.SetOnScrollListener(new OnScrollListener()); refresher = FindViewById <SwipeRefreshLayout>(Resource.Id.refresher); refresher.SetColorScheme(Resource.Color.xam_dark_blue, Resource.Color.xam_purple, Resource.Color.xam_gray, Resource.Color.xam_green); refresher.Refresh += HandleRefresh; var intent = new Intent(this, typeof(RegistrationIntentService)); StartService(intent); LoadNews(); }
public override View OnCreateView(LayoutInflater inflater ,ViewGroup container ,Bundle savedInstanceState) { View v = inflater.Inflate(Resource.Layout.MyHealth_tab_1 ,container ,false); //TextView tvText = v.FindViewById<TextView> (Resource.Id.textView); recyclerView = v.FindViewById <RecyclerView> (Resource.Id.recyclerView); progressDialog = ProgressDialog.Show (Activity, "Sila Tunggu", "Sedang Memuatkan..."); llMHeT1ErrorLayout = (LinearLayout)v.FindViewById (Resource.Id.llMHeT1ErrorLayout); tvMHeT1ErrorStatus = (TextView)v.FindViewById (Resource.Id.tvMHeT1ErrorStatus); tvMHeT1ErrorStatus.Text = "Sedang memeriksa data..."; mSlideRefreshLayout = v.FindViewById<SwipeRefreshLayout> (Resource.Id.swipelayout); mSlideRefreshLayout.SetColorScheme (Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloBlueDark, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloRedLight); mSlideRefreshLayout.Refresh += mSlideRefreshLayout_Refresh; if (recyclerView != null) { recyclerView.HasFixedSize = true; var layoutManager = new LinearLayoutManager (Activity); var onScrollListener = new MyHealthRecyclerViewOnScrollListener (layoutManager); onScrollListener.LoadMoreEvent += (object sender, EventArgs e) => { Console.Error.WriteLine ("isRefeshing" + isRefreshing); page++; if (page <= lastPage && isRefreshing == false) { Console.Error.WriteLine ("masuk"); ThreadPool.QueueUserWorkItem (o => { setupMyHealthData (page); }); } }; recyclerView.AddOnScrollListener (onScrollListener); recyclerView.SetLayoutManager (layoutManager); } return v; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var root = inflater.Inflate(Resource.Layout.fragment_events, container, false); refresher = root.FindViewById <SwipeRefreshLayout>(Resource.Id.refresher); refresher.SetColorScheme(Resource.Color.blue); refresher.Refresh += async delegate { if (viewModel.IsBusy) { return; } await viewModel.GetEventsAsync(); Activity.RunOnUiThread(() => { ((BaseAdapter)listView.Adapter).NotifyDataSetChanged(); }); }; viewModel.PropertyChanged += PropertyChanged; listView = root.FindViewById <ListView>(Resource.Id.list); listView.Adapter = new EventAdapter(Activity, viewModel); listView.ItemLongClick += ListViewItemLongClick; var fab = root.FindViewById <FloatingActionButton>(Resource.Id.fab); fab.AttachToListView(listView); fab.Click += (sender, args) => { Activity.StartActivity(typeof(NewEventActivity)); }; return(root); }
public override View OnCreateView(LayoutInflater inflater ,ViewGroup container ,Bundle savedInstanceState) { View v = inflater.Inflate(Resource.Layout.MySoal_tab_1 ,container ,false); //TextView tvText = v.FindViewById<TextView> (Resource.Id.textView); recyclerView = v.FindViewById <RecyclerView> (Resource.Id.recyclerView); llMST1ErrorLayout = (LinearLayout)v.FindViewById (Resource.Id.llMST1ErrorLayout); tvMST1ErrorStatus = (TextView)v.FindViewById (Resource.Id.tvMST1ErrorStatus); footerViewUL = ((LayoutInflater)Activity.GetSystemService (Context.LayoutInflaterService)).Inflate (Resource.Layout.MySoal_ReadMoreLayout, null, false); mSlideRefreshLayout = v.FindViewById<SwipeRefreshLayout> (Resource.Id.swipelayout); mSlideRefreshLayout.SetColorScheme (Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloBlueDark, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloRedLight); mSlideRefreshLayout.Refresh += mSlideRefreshLayout_Refresh; if (recyclerView != null) { recyclerView.HasFixedSize = true; var layoutManager = new LinearLayoutManager (Activity); var onScrollListener = new MySoalRecyclerViewOnScrollListener (layoutManager); onScrollListener.LoadMoreEvent += (object sender, EventArgs e) => { Console.Error.WriteLine ("isRefeshing" + isRefreshing); page++; if (page <= lastPage && isRefreshing == false) { Console.Error.WriteLine ("masuk"); ThreadPool.QueueUserWorkItem (o => { InitialProgress (page); }); } }; recyclerView.AddOnScrollListener (onScrollListener); recyclerView.SetLayoutManager (layoutManager); } return v; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.activity_main); //Reference swiperefresh layout, set color scheme classSwipeRefresh = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeLayout); classSwipeRefresh.SetColorScheme(Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight, Android.Resource.Color.HoloGreenLight); //Initilize UI Components myListView = FindViewById <ListView>(Resource.Id.myListView); editSearch = FindViewById <EditText>(Resource.Id.editSearch); headerAddressLine = FindViewById <TextView>(Resource.Id.headerAddressLine); headerCity = FindViewById <TextView>(Resource.Id.headerCity); headerState = FindViewById <TextView>(Resource.Id.headerState); headerZipCode = FindViewById <TextView>(Resource.Id.headerZipCode); //Adjust Search bar to be invisable and viewstates to gone editSearch.Alpha = 0; editSearch.Visibility = ViewStates.Gone; //Activate customer toolbar toolBar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolBar); SupportActionBar.Title = ""; //Download data from MYSQL Using PHP mProgressBar = FindViewById <ProgressBar>(Resource.Id.progressBar); mClient = new WebClient(); mUrl = new Uri("http://192.168.1.22:80/christmaslightsPHP/getAddresses.php"); mClient.DownloadDataAsync(mUrl); //Events myListView.ItemClick += MyListView_ItemClick; classSwipeRefresh.Refresh += ClassSwipeRefresh_Refresh; editSearch.TextChanged += EditSearch_TextChanged; headerAddressLine.Click += HeaderAddressLine_Click; headerCity.Click += HeaderCity_Click; headerState.Click += HeaderState_Click; headerZipCode.Click += HeaderZipCode_Click; mClient.DownloadDataCompleted += MClient_DownloadDataCompleted; }
public override View OnCreateView(LayoutInflater inflater ,ViewGroup container ,Bundle savedInstanceState) { tokenData = Activity.Intent.GetStringExtra ("Token"); View v = inflater.Inflate(Resource.Layout.MyKomuniti_tab_1 ,container ,false); //TextView tvText = v.FindViewById<TextView> (Resource.Id.textView); recyclerView = v.FindViewById <RecyclerView> (Resource.Id.recyclerView); progressDialog = ProgressDialog.Show (Activity, "Sila Tunggu", "Sedang Memuatkan..."); llMKkT1ErrorStatus = (LinearLayout)v.FindViewById (Resource.Id.llMKkT1ErrorStatus); tvMKkT1ErrorStatus = (TextView)v.FindViewById (Resource.Id.tvMKkT1ErrorStatus); mSlideRefreshLayout = v.FindViewById<SwipeRefreshLayout> (Resource.Id.swipelayout); mSlideRefreshLayout.SetColorScheme (Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloBlueDark, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloRedLight); mSlideRefreshLayout.Refresh += mSlideRefreshLayout_Refresh; if (recyclerView != null) { recyclerView.HasFixedSize = true; var layoutManager = new LinearLayoutManager (Activity); var onScrollListener = new MyKomunitiRecyclerViewOnScrollListener (layoutManager); onScrollListener.LoadMoreEvent += (object sender, EventArgs e) => { page++; if (page <= lastPage && isRefreshing == false) { ThreadPool.QueueUserWorkItem (o => { InitialSetup (tokenData, page); }); } }; recyclerView.AddOnScrollListener (onScrollListener); recyclerView.SetLayoutManager (layoutManager); } return v; }
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.SetColorScheme(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)); BackgroundTextView = (TextView)view.FindViewById<TextView>(Resource.Id.backgroundTextView); BackgroundTextView.Text = EmptyTableString; return view; }
public override View OnCreateView(LayoutInflater inflater ,ViewGroup container ,Bundle savedInstanceState) { View v = inflater.Inflate(Resource.Layout.MyHealth_tab_2 ,container ,false); recyclerView = v.FindViewById <RecyclerView> (Resource.Id.recyclerViewTakwim); //mListView = v.FindViewById <ListView> (Resource.Id.listViewContainer); //mListView = v.FindViewById <ListView> (Android.Resource.Id.List); llMHeT2ErrorLayout = (LinearLayout)v.FindViewById (Resource.Id.llMHeT2ErrorLayout); tvMHeT2ErrorStatus = (TextView)v.FindViewById (Resource.Id.tvMHeT2ErrorStatus); mSlideRefreshLayout = v.FindViewById<SwipeRefreshLayout> (Resource.Id.swipelayout); mSlideRefreshLayout.SetColorScheme (Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloBlueDark, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloRedLight); mSlideRefreshLayout.Refresh += mSlideRefreshLayout_Refresh; if (recyclerView != null) { recyclerView.HasFixedSize = true; var layoutManager = new LinearLayoutManager (Activity); var onScrollListener = new MyHealthBWRecyclerViewOnScrollListener (layoutManager); onScrollListener.LoadMoreEvent += (object sender, EventArgs e) => { page++; if (page <= lastPage && isRefreshing == false) { ThreadPool.QueueUserWorkItem (o => { setupMyHealthData (page); }); } }; recyclerView.AddOnScrollListener (onScrollListener); recyclerView.SetLayoutManager (layoutManager); } return v; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.layout1_main); var toolbar = (Toolbar)FindViewById(Resource.Id.toolbar); SetSupportActionBar(toolbar); SupportActionBar.Title = GetString(Resource.String.title_activity1); update(); // events listView.ItemClick += OnListItemClick; FindViewById <ImageView>(Resource.Id.iv_ad1).Click += (s, e) => StartUrl("https://www.facebook.com/kergejoustik?sk=wall"); FindViewById <ImageView>(Resource.Id.iv_ad2).Click += (s, e) => StartUrl("https://www.youtube.com/user/kergej6ustik"); FindViewById <ImageView>(Resource.Id.iv_ad3).Click += (s, e) => StartUrl("http://sport.delfi.ee/news/kergejoustik/?l=tn_sport"); FindViewById <ImageView>(Resource.Id.iv_ad4).Click += (s, e) => StartUrl("http://ekjl.ee/"); mSwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeLayout); mSwipeRefreshLayout.SetColorScheme(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 bundle) { handler = new Handler(); base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); swipe_refresh_layout = FindViewById<SwipeRefreshLayout>(Resource.Id.swipe_refresh_layout); // Setup the actionbar indicator // To use the default layout: // Set the background color swipe_refresh_layout.SetActionBarSwipeIndicatorBackgroundColor(Resources.GetColor(Resource.Color.swipe_to_refresh_background)); // Set the text colors. Failing to do so will cause the text to not be displayed. swipe_refresh_layout.SetActionBarSwipeIndicatorTextColor(Resources.GetColor(Resource.Color.swipe_to_refresh_text)); swipe_refresh_layout.SetActionBarSwipeIndicatorRefreshingTextColor(Resources.GetColor(Resource.Color.swipe_to_refresh_text)); // Or you can use a custom layout... // This is recommended if you want more control over the text styling. //swipe_refresh_layout.SetActionBarSwipeIndicatorLayout(Resource.Layout.swipe_indicator, Resource.Id.text); // Set the text to be displayed. swipe_refresh_layout.SetActionBarSwipeIndicatorRefreshingText(Resource.String.loading); swipe_refresh_layout.SetActionBarSwipeIndicatorText(Resource.String.swipe_to_refresh); // Setup colors swipe_refresh_layout.SetColorScheme( Resource.Color.refreshing_color1, Resource.Color.refreshing_color2, Resource.Color.refreshing_color3, Resource.Color.refreshing_color4); // Set the listener swipe_refresh_layout.Refresh += OnRefresh; }
public void inicializarSwipeRefreshLayout() { mSwipeRefreshLayout.SetColorScheme(Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloBlueDark, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloRedLight); mSwipeRefreshLayout.Refresh += mSwipeRefreshLayout_Refresh; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = (View) inflater.Inflate(Resource.Layout.cardView_layout,container, false); //CardView mRecyclerView = view.FindViewById<RecyclerView>(Resource.Id.recyclerView); mCardViewHuoJing = new List<CardViewHuoJing>(); FragmentManager fragmentManager1 = this.FragmentManager; string strURL= this.Resources.GetString(Resource.String.HttpUri)+ String.Format("andriod/bjxx_intime_andriod.jsp?") + String.Format("userId={0}&userType={1}",LogInfoCardView.userId,LogInfoCardView.userType); Console.WriteLine (strURL); mHttpRequestCardView.HttpRequestFunc (strURL); doc.LoadXml(mHttpRequestCardView.HttpRecv); foreach (XmlNode node in doc.SelectNodes("FireIntime/Info/Fire")) { mCardViewHuoJing.Add (new CardViewHuoJing (){ bjxxbh=node.Attributes["bjxxbh"].Value, dwmc=node.Attributes["dwmc"].Value, lxdz=node.Attributes["lxdz"].Value, lxr=node.Attributes["lxr"].Value, khlb=node.Attributes["khlb"].Value, gddh=node.Attributes["gddh"].Value, bjdz=node.Attributes["bjdz"].Value, asebh=node.Attributes["asebh"].Value, ipphone=node.Attributes["ipphone"].Value, quhao=node.Attributes["quhao"].Value, bjsj=node.Attributes["bjsj"].Value, bjjb=node.Attributes["bjjb"].Value, flag=node.Attributes["flag"].Value, bn=node.Attributes["bn"].Value }); } //mCardViewHuoJing.Add(new Email() { Name = "tom", Subject = "Wanna hang out?", Message = "I'll be around tomorrow!!" }); mLayoutManager = new LinearLayoutManager(Application.Context); mRecyclerView.SetLayoutManager(mLayoutManager); mAdapter = new RecyclerAdapter(mCardViewHuoJing, mRecyclerView,1,Application.Context,fragmentManager1); mRecyclerView.SetAdapter(mAdapter); //swipeRefresh mSwipeRefreshLayout = view.FindViewById<SwipeRefreshLayout> (Resource.Id.swipeLayout); mSwipeRefreshLayout.SetColorScheme (Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloRedLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloPurple); mSwipeRefreshLayout.Refresh += mSwipeRefreshLayout_Refresh; //mRecyclerView.Click += mRecyclerView_Click; return view ; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Instantiate the photo album: mPhotoAlbum = new PhotoAlbum(); // Set our view from the "main" layout resource: SetContentView(Resource.Layout.Main); interstitialAds = new InterstitialAd(this); mAdView = FindViewById <AdView>(Resource.Id.adView); var adRequest = new AdRequest.Builder().Build(); mAdView.LoadAd(adRequest); interstitialAds.AdUnitId = "ca-app-pub-1120846610061033/5377390906"; // loading test ad using adrequest interstitialAds.LoadAd(adRequest); interstitialAds.AdListener = new AdListener(this); var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); SupportActionBar.Title = "BEST TIPSTARS"; SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu); SupportActionBar.SetDisplayHomeAsUpEnabled(true); drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); myfab = FindViewById <FloatingActionButton>(Resource.Id.fab); // Get our RecyclerView layout: mRecyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); //............................................................ // Layout Manager Setup: // Use the built-in linear layout manager: mLayoutManager = new LinearLayoutManager(this); // Or use the built-in grid layout manager (two horizontal rows): // mLayoutManager = new GridLayoutManager // (this, 2, GridLayoutManager.Horizontal, false); // Plug the layout manager into the RecyclerView: mRecyclerView.SetLayoutManager(mLayoutManager); myswipeRefresh = FindViewById <SwipeRefreshLayout>(Resource.Id.refresher); myswipeRefresh.SetColorScheme(Resource.Color.Red, Resource.Color.Orange, Resource.Color.Yellow, Resource.Color.Green, Resource.Color.Blue, Resource.Color.Indigo, Resource.Color.Violet); myswipeRefresh.Refresh += MyswipeRefresh_Refresh; //............................................................ // Adapter Setup: // Create an adapter for the RecyclerView, and pass it the // data set (the photo album) to manage: mAdapter = new PhotoAlbumAdapter(mPhotoAlbum); // Register the item click handler (below) with the adapter: mAdapter.ItemClick += OnItemClick; // Plug the adapter into the RecyclerView: mRecyclerView.SetAdapter(mAdapter); navigationView.NavigationItemSelected += (sender, e) => { e.MenuItem.SetChecked(true); Intent intent = null; switch (e.MenuItem.ItemId) { case Resource.Id.nav_about: intent = new Intent(this, typeof(About)); break; case Resource.Id.nav_share: intent = new Intent(Intent.ActionSend); intent.SetType("text/plain"); intent.PutExtra(Intent.ExtraText, "https://play.google.com/store/apps/details?id=com.hamsempire.bestpredictions"); break; } if (intent != null) { StartActivity(intent); } drawerLayout.CloseDrawers(); }; myfab.Click += async delegate(object sender, EventArgs e) { myswipeRefresh.Refreshing = true; await Task.Delay(5000); myswipeRefresh.Refreshing = false; }; }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.searchResult); var app = ((InitApp)ApplicationContext); if (app != null) { app.addActivity(this); } tv_question = FindViewById <TextView>(Resource.Id.tv_question); tv_news = FindViewById <TextView>(Resource.Id.tv_news); tv_kb = FindViewById <TextView>(Resource.Id.tv_kb); tv_blog = FindViewById <TextView>(Resource.Id.tv_blog); search_keyword = FindViewById <SearchView>(Resource.Id.search_keyword); _recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout); swipeRefreshLayout.SetColorScheme(Resource.Color.primary); swipeRefreshLayout.Refreshing = false; StatusBarUtil.SetColorStatusBars(this); category = Intent.GetStringExtra("category"); keyword = Intent.GetStringExtra("keyword"); startQuery = Intent.GetBooleanExtra("startquery", false); initCategoryClick(); //初始化category单击事件 initCategoryByCategory(); //初始化category 选中的状态 toolbar.SetNavigationIcon(Resource.Drawable.back_24dp); toolbar.NavigationClick += (s, e) => { ActivityCompat.FinishAfterTransition(this); }; swipeRefreshLayout.Refresh += (s, e) => { swipeRefreshLayout.PostDelayed(() => { swipeRefreshLayout.Refreshing = false; }, 1000); }; _recyclerView.SetLayoutManager(new Android.Support.V7.Widget.LinearLayoutManager(this)); //search_keyword.SubmitButtonEnabled = true; //默认为false 不显示提交按钮,是否启用提交按钮 search_keyword.OnActionViewExpanded(); //手动展开SearchView输入框,初始可以点击输入的状态 //search_keyword.SetIconifiedByDefault(false); //默认是为true 不显示输入框键盘,默认提交按钮不显示,该属性设置为false,则直接展开输入框弹出键盘 // search_keyword.RequestFocus(); //将控件设置成可获取焦点状态,默认是无法获取焦点的,只有设置成true,才能获取控件的点击事件 //search_keyword.Focusable = true; search_keyword.ClearFocus(); search_keyword.Focusable = true; if (!string.IsNullOrEmpty(keyword)) { search_keyword.QueryHint = keyword; } search_keyword.FocusChange += (s, e) => { System.Diagnostics.Debug.Write(e.HasFocus); if (e.HasFocus) { SearchInputActivity.Enter(category, this); } }; search_keyword.SetOnQueryTextFocusChangeListener(this); search_keyword.QueryTextSubmit += async(s, e) => { keyword = search_keyword.Query.Trim(); if (keyword == null || keyword.Length == 0) { return; } SearchHistoryShared.SetSearchHistory(keyword, this); swipeRefreshLayout.Refreshing = true; await listSearchService((list) => { swipeRefreshLayout.PostDelayed(() => { swipeRefreshLayout.Refreshing = false; }, 1000); searchList = list; initRecycler(); }); }; if (startQuery) { initCategoryByCategory(); SearchHistoryShared.SetSearchHistory(keyword, this); if (!string.IsNullOrEmpty(keyword)) { swipeRefreshLayout.Refreshing = true; await listSearchService((list) => { swipeRefreshLayout.PostDelayed(() => { swipeRefreshLayout.Refreshing = false; }, 1000); searchList = list; initRecycler(); }); } } }
private async void init(Bundle savedInstanceState) { drawerLayout = this.FindViewById <DrawerLayout>(Resource.Id.drawer_layout); //Set hamburger items menu SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu); //setup navigation view navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); navigationView.SetCheckedItem(Resource.Id.nav_home_1); userName = navigationView.GetHeaderView(0).FindViewById <TextView>(Resource.Id.tvName); TextView userEmail = navigationView.GetHeaderView(0).FindViewById <TextView>(Resource.Id.tvEmail); //handle navigation navigationView.NavigationItemSelected += (sender, e) => { e.MenuItem.SetChecked(true); switch (e.MenuItem.ItemId) { case Resource.Id.nav_home_1: ListItemClicked(0); break; case Resource.Id.nav_home_2: ListItemClicked(1); break; case Resource.Id.nav_home_3: ListItemClicked(2); break; case Resource.Id.nav_home_4: ListItemClicked(3); break; case Resource.Id.nav_home_5: ListItemClicked(4); break; case Resource.Id.nav_home_6: ListItemClicked(5); break; } drawerLayout.CloseDrawers(); }; //if first time you will want to go ahead and click first item. //if (savedInstanceState == null) //{ // ListItemClicked(0); //} fab = FindViewById <FloatingActionButton>(Resource.Id.fab); fab.SetVisibility(ViewStates.Gone); fab.Click += delegate { fabFunctions(); }; refresh = FindViewById <SwipeRefreshLayout>(Resource.Id.refresher); refresh.SetColorScheme(Resource.Color.refresher_1, Resource.Color.refresher_2); refresh.Refresh += delegate { refreshData(refreshIdentifier); }; //setting the cookies var rtFa = Intent.GetStringExtra("rtFa"); var FedAuth = Intent.GetStringExtra("FedAuth"); online = Intent.GetBooleanExtra("connection", false); core = new PsCore(rtFa, FedAuth); helpDialog = new DialogHelpers(); //setting formDigest prefs = PreferenceManager.GetDefaultSharedPreferences(this); core.setClient(); if (online) { string context = await core.GetFormDigest(""); ThreadPool.QueueUserWorkItem(state => { try { var data = JsonConvert.DeserializeObject <AndroidApp1.FormDigestModel.RootObject>(context); core.setClient2(data.D.GetContextWebInformation.FormDigestValue); core.FormDigest = data.D.GetContextWebInformation.FormDigestValue; } catch (Exception e) { RunOnUiThread(() => { mText = "You have no acces on this site"; switchFragment(new OfflineFragment()); willSwitch = true; }); } }); ThreadPool.QueueUserWorkItem(async state => { var data2 = await core.GetCurrentUser(); var currentUser = JsonConvert.DeserializeObject <CurrentUser.RootObject>(data2); RunOnUiThread(async() => { userName.Text = currentUser.D.Title; userEmail.Text = currentUser.D.Email; if (prefs.GetString("userName", "").Equals("") && prefs.GetString("email", "").Equals("")) { ISharedPreferencesEditor editor = prefs.Edit(); editor.PutString("userName", currentUser.D.Title); editor.PutString("email", currentUser.D.Email); editor.Apply(); //prefs.Edit().PutString("userName", currentUser.D.Title).Apply(); //prefs.Edit().PutString("email", currentUser.D.Email).Apply(); } hasAccess = await checkUserAccess(currentUser.D.Title); if (hasAccess) { checkDataAsync(PROJECT_DATA); } else { mText = "You have no acces on this site"; switchFragment(new OfflineFragment()); willSwitch = true; } }); }); } else { if (!prefs.GetString("userName", "").Equals(null) && !prefs.GetString("email", "").Equals(null)) { userName.Text = prefs.GetString("userName", ""); userEmail.Text = prefs.GetString("email", ""); } switchFragment(new OfflineFragment()); willSwitch = true; } tasksWithResource = new List <string> { }; //checkDataAsync(PROJECT_DATA); }