xamarin.android

Is there a way to set a particular Tablayout.Tab text color programmatically, without using a state list?

纵然是瞬间 提交于 2019-12-13 03:29:26
问题 The question is how to change a single TabLayout.Tab's text color. Ideally, I'd like to iterate over the tabs and change their color based on information contained on the fragment of a corresponding ViewPager. 回答1: The easiest way is to get the TextView from a specified TabLayout.Tab and then set the text color using TextView.SetTextColor(Color color) , which you can do as followed: TabLayout tabLayout = new TabLayout(this); int wantedTabIndex = 0; TextView tabTextView = (TextView)((

Azure AD (ADAL) Login Screen Loses Entered User Email on Device Orientation in Android Only-XamarinForms.Android

妖精的绣舞 提交于 2019-12-13 03:18:43
问题 I have Xamarin.Forms application that authenticates user against Azure AAD using ADAL ( Microsoft.IdentityModel.Clients.ActiveDirectory ). That all works fine but on Android, device orientation looses user email on the Microsoft authentication screen. Here I am in Portrait mode and I have entered user email: Clicking on Next lands on screen asking to enter password. If I now rotate device on Android, it will return me back to blank screen above, user email I entered above is lost: Device

Toggleable save button in Xamarin Android

徘徊边缘 提交于 2019-12-13 03:10:48
问题 I've create a layout that lists a List of objects in a RecyclerView . I would like to add the option for the user to save a certain object, but I have no idea how to achieve something like the layout bellow. I need a button that can be toggled, and that if the user clicks it, it will fill the heart button with red, otherwise, it will be empty. Thank you. Layout 回答1: If you want that heart to fill from nothing to full using some kind of animation, I'd suggest looking into SkiaSharp (https:/

Difference between tinting a child View and the containing ViewGroup

。_饼干妹妹 提交于 2019-12-13 03:08:54
问题 I'm trying to better understand the following situation that arose while refactoring some "selection highlighting" code (to take advantage of tinting). There's a list that's populated with an adapter, CodebookAdapter , where each item's defined as: CodebookAdapter List Item Layout <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:background="#FFFFFFFF"> <ImageView android:id="@

Xamarin.Android Creating And Using Custom Controls

青春壹個敷衍的年華 提交于 2019-12-13 03:01:56
问题 Another tough day with Xamarin! So, today, i am trying to figure out how one can create and use a custom control in Xamarin.Android . I read all the docs and all were on Xamarin.Forms . I wonder why there is so less support for Xamarin.Android . Anyways, i came across a few questions on SO and tried this : TestControl.cs namespace TestApp.CustomControls.Classes { public class TestControl : ViewGroup { protected override void OnLayout(bool changed, int l, int t, int r, int b) { throw new

Xamarin.Android How to Get Google Play Store app version number using Dcsoup Nuget Plugin?

痴心易碎 提交于 2019-12-13 02:58:01
问题 I am trying to get the latest version number of my store app in order to notify user for updates if they are using an older version. This is my code so far but its obviously just retrieving the div containing the text "Version Number". How do I get the actual version number (in this case 1.1) referring to the attached screenshot of the DOM tree? public static string GetAndroidStoreAppVersion() { string androidStoreAppVersion = null; try { using (var client = new HttpClient()) { var doc =

Database File Location for SQLite within MonoDroid

此生再无相见时 提交于 2019-12-13 02:48:24
问题 When using the following code to copy a SQLite database from an Assets folder , the output is being put in the following folder: "/data/data/AndroidTestDb.AndroidTestDb/files/AndroidTestDup.db" Here is the code: Stream myInput = Assets.Open(@"AndroidTest.db"); string outFileName=System.IO.Path.Combine(System.Environment.GetFolderPath (System.Environment.SpecialFolder.Personal), "AndroidTestDup.db"); Stream myOutput = new FileStream(outFileName, FileMode.OpenOrCreate); And the desired folder

How to set background in the first position as default?

余生颓废 提交于 2019-12-13 02:45:41
问题 Follow code: Fragment1.cs: public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = inflater.Inflate(Resource.Layout.fragment_1, container, false); gridView = (GridView)view.FindViewById(Resource.Id.grid_view); gridView.ItemClick += (sender, e) => { if (view_1 != null) { view_1.SetBackgroundColor(Color.Transparent); } view_1 = e.View; e.View.SetBackgroundColor(Color.ParseColor("#FFC107")); }; adapter = new ArrayAdapter<string>

Why is xamarin appending a hash as a namespace?

China☆狼群 提交于 2019-12-13 02:39:37
问题 Running aapt against my apk, I see that something is appending a hash in front of my activity name, where I'd normally expect to see my namespace. Here is the aapt output... C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.1>aapt dump badging c:\base.apk package: name='fr.company.DematAEAT_Android' versionCode='1' versionName='1.0' platformBuildVersionName='4.0.4-1406430' install-location:'auto' sdkVersion:'11' uses-permission: name='android.permission.INTERNET' uses-permission:

Not able to fire the ListVIew Item click event when there is UI Control like Button in xamarin

丶灬走出姿态 提交于 2019-12-13 02:36:51
问题 Here I am not able to fire the ListView Item click event. this is my code with MainActivity.cs file , Main.axml file and MainActivityAdapter.cs file. MainActivity .cs public class MainActivity : Activity { private ListView _contactsView; private List<Contact> _contacts; protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); //not able to fire event FindViewById<Button>(Resource.Id.add)