How to make Android GridLayout compatible to older version? - android

New GridLayout for Android 4 is good. Both in terms of code maintainability and performance.
I wanted help with backward compatibility for GridLayout for older version. Waiting for official compatibile package is taking too long. I know its possible and someone did mention that this could be done by copying the class from version 4 platform source.
Would be really great if anybody could guide me how to do this.
For reference please check this post on Google Plus
https://plus.google.com/105051985738280261832/posts/KbqAxUQTzVf

A better way of doing this is using Android Support Library.
Since resource files are also involved it cannot be included as .jar library.
Update the android SDK and support files.
Add your-android-sdk\extras\android\support\v7\gridlayout project to eclipse.
Make the project as library.
Add this library project to your working project.
To use gridlayout in XML use it like this
<android.support.v7.widget.GridLayout> </android.support.v7.widget.GridLayout>
Hope that was helpful.

Check out this project: https://github.com/dlew/android-gridlayout

Related

how android determine the available themes for a project

I have done a lot of googling but very surprised that I can not find ANY answer. I am not sure for a specifc project what is the available themes for it. It seems could be decided by :
The project target api level
The referenced library (implementation) in your gradle file
The Android Studio version,
etc...
A follow up question is, if you have an activty in your library project that use a specific theme, is it possbile that the theme does not existing in the project that use the library. If so, what is the right way to fix it.
Many thanks in advance.
Googled and searched in stackover flow, nothing at all

Does Autofindviews supports Android 11?

I am looking for answers related to Autofindviews nuget and its compatibility.
As per this link [AutoFindViews Nuget] (https://www.nuget.org/packages/AutoFindViews/) under framework I could see they mentioned the product version as MonoAndroid10.
Does that mean this nuget will support for Android projects targeting till Android10?
If it supports till Android 10, I am facing an issue where it gives below error while trying to migrate the Xamarin.Android project from Android 9 to Android 10 (Where the packages are updated to AndroidX and Support widgets in layout files are changed to androidx )
Error CS0246 The type or namespace name 'Androidx' could not be found (are you missing a using directive or an assembly reference?)
Can anyone please help me understanding this? Thanks in Advance
Bro, at Google I/O 2018, the Android team announced AndroidX, but the Autofindviews nuget which is just used to replace the FindViewById method last update at the 2017. So It can't find the view in the AndroidX library.
So you can try the three solution :
Remove the reference of the Autofindviews nuget and do the FindViewById by yourself.
Have a mixed use between the Support Library and the AndroidX Library. Only use the view which belongs to the Support Library in the xml. You can also use Support Library in the Android 10.
Try to use another nuget package, such as xamarin.androidx.viewbinding.databinding 4.1.2.

I don't have a separate folder called values v21

I am using android studio 1.0
Trying to make material design app that is compatible with older versions of android too...
Made new blank project, Added compile 'com.android.support:appcompat-v7:21.0.3' dependency to the gradle file
Still no luck :/
Anyone please help me out....
Create the values-v21 folder and create styles.xml
Inside styles.xml choose Material Theme.
It was in older versions of Android Sudio. In Android Studio 1.0 you have to create by yourself.
Check your SDK version update it to Android 5.0 (Api 21).
And you will be good to go.
Maintain material design Compatibility to older version of Android by following this link.
https://developer.android.com/training/material/compatibility.html
Cheers..
If you want to make a material design app that is compatible with older versions of Android, you really need to include the library
'com.android.support:appcompat-v7:21.+'
And make some changes to your app. This link shows a pretty good how to
http://android-developers.blogspot.com.br/2014/10/appcompat-v21-material-design-for-pre.html
The most importante change is the new Toolbar, that you can eather include in every layout you want, or work with "ActioBarActivities". Again, reading this official blog post will help you.
But, as the title of your question said, you can create a folder called "values-21" and put a new "style.xml", that will target only Android Lollipop. In this file, you can extend android:Theme.Material and use some features that are only present in Android 5.0, like ripples and some animations.

Tree List View In Android

I am trying to do a tree list in android using this project library.
First: I cannot import it in Eclipse. I am getting the following error:
[2014-01-15 14:58:18 - tree-view-list-android] Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties.
even if I try go to the project properties I am getting the same error and I cannot open it.
Second: I found different version on the project HERE but there is no documentation at all.
I was wondering if there is another approach to complete the task. I checked that I can accomplish it using so called ExpandableListView but they can handle only up to two levels and I want more.
Any suggestions???
Thank you in advance!!!
I've implemented it with Custom ListView, here's a link where I've posted example of my implementation:
Link: https://stackoverflow.com/a/20518117/2219052
Hope it helps.

Action Bar for android < 3.0

I want use ActionBar for my application but i found it can't use for android < 3.0.
I found this https://github.com/johannilsson/android-actionbar to solved my problem but I get error at
import com.markupartist.android.widget.ActionBar;
import com.markupartist.android.widget.ActionBar.Action;
import com.markupartist.android.widget.ActionBar.IntentAction;
Give ActionBarSherlock a try. I use it for one of my projects and after some reading of the docs and the samples it just worked. The samples are easy and straight forward, you should be able to extract what you need from them.
To see what it's able of just download the sample app from the market: Sample App (requires at least Android 1.6)
You should add the code to a library, and add the library to your project.
To do this in Eclipse create a new project, using the same package name as the github project (so com.markupartist.android.widget). In the properties select the project to be a library under the Java Build Path tab. Then, in your project, go to its properties, and select the library.
I think your including files are missing (JAR libs) , Click on error icon and then select fix project setup.
I spent around 10 hours trying to fix this problem. All the above ans does not work. Actually what is missing is android support library. To fix this, right click on project, >Android Tool> Add Support Library. Hope this save alot of time for other who came across this. just add support library both on your ActionBar library and the current project.

Categories

Resources