blandware / android-atleap Goto Github PK
View Code? Open in Web Editor NEWAndroid accelerator (keywords: ContentProvider, ORMLite, Account Authenticator)
License: Apache License 2.0
Android accelerator (keywords: ContentProvider, ORMLite, Account Authenticator)
License: Apache License 2.0
After first run this fragment, DefaultMenuItemPosition don't checked in list. Because loading logic getDefaultMenuItemPosition ()
occurs before creating mMenuListView
.
Approximate solution:
In BaseDrawerFragment move
if (savedInstanceState == null) { selectMenuItem(getDefaultMenuItemPosition()); }
of onCreate
to onCreateView
method
Looks great and I'm trying to use it in a project, but lacks documentation...
Could BaseActivity extend AppCompatActivity instead of ActionBarActivity?
ContentValues myValues = new ContentValues();
// myValues.put(field, value);
ContentResolver contentResolver = ...;
Uri newlyCreatedPath = contentResolver.insert(AUTHORITY, myValues);
// This cause NullPointerException as soon as Uri comes back in format as this
// content://CONTENT_AUTHORITY/TABLE_NAME/null
// where null should be _ID of newly created object
long idOfNewlyCreatedObject = Long.valueOf(newCreatedPath.getLastPathSegment());
Hi thank you for sharing you experience. Ive stumbled on issue described above. The way I
ve configured UriMatcher
and Provider
was copied from you samples. And it is follow.
public class UriMatcher extends OrmLiteUriMatcher {
public UriMatcher(String authority) {
super(authority);
}
@Override
public void instantiate() {
addClass(PATH_REMINDERS, Reminder.class);
addClass(PATH_REMINDER, Reminder.class);
}
}
public class MyProvider extends OrmLiteProvider {
@Override
protected OrmLiteSqliteOpenHelper createHelper() {
return new AtopiDatabaseHelper(getContext());
}
@Override
public UriMatcher getUriMatcher() {
return SQLiteUriMatcher.getInstance(UriMatcher.class, TableContracts.CONTENT_AUTHORITY);
}
@Override
public String getAuthority() {
return TableContracts.CONTENT_AUTHORITY;
}
}
Can you fix behavior of your provider so it would return id
of newly created instance?
Hi guys!
If I decrease the "targetSdkVersion" to less than 19 (e.g. targetSdkVersion=18),
I get the following error from Gradle:
:app:generateDebugBuildConfig
:app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest
[/Users/markonovak/AndroidStudioProjects/TomUp/app/src/main/AndroidManifest.xml, /Users/markonovak/AndroidStudioProjects/TomUp/app/build/exploded-aar/com.blandware.android.atleap/core/0.1/AndroidManifest.xml:2] Main manifest has but library uses targetSdkVersion='19'
Is there perhaps a reason why android-atleap needs targetSdkVersion=19?
Do you perhaps have some suggestion what else I could do to to fix the error
above, besides setting targetSdkVersion to 19? I had to decrease targetSdkVersion in the first place, because the Robolectric library doesn't work for targetSdkVersion=19.
Thank you for your answer.
Marko Novak
Approximate solution:
@OverRide
public void onDrawerSlide(View drawerView, float slideOffset) {
if (drawerConfig.isAnimationOn) {
super.onDrawerSlide(drawerView, slideOffset)
} else {
super.onDrawerSlide(drawerView, 0); // this disables the animation
}
}
Approximate solution:
public void selectMenuItem(int position) {
if (mMenuListView != null) {
mMenuListView.setItemChecked(position + numHeaders, true);
}
I'm trying to insert rows using the ContentProvider.
The ID of my table is declared as :
@DatabaseField(columnName = BaseColumns._ID, generatedId = true)
private int id;
When inserting, the id field is generated automatically, but
Uri uri = getContentResolver().insert(Contract.MyTableContract.CONTENT_URI, values);
uri value is : content://com.myapp.android/mytable/null
I'm not setting the field _ID in my ContentValues.
My purpose here is to get the id of the newly inserted row.
Do you have any idea on how to solve this ?
Approximate solution:
mMenuListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@OverRide
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
int posWithoutHeader = position - mMenuListView.getHeaderViewsCount();
selectMenuItem(posWithoutHeader);
}
});
How can I setup/retrieve the DAOs ? I'd like to be able to easily get objects from ORMLite.
Anyway many thanks for this great lib ๐
BaseDrawerFragment
change in class acces level protected -> public
for the following methods:
protected void selectMenuItem(int position)
protected int getDefaultMenuItemPosition()
protected ActionBar getActionBar()
protected void initUpIcon()
protected void onDrawerOpened(View drawerView)
protected void onDrawerClosed(View drawerView)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.