forked from iSoron/uhabits
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
77 changed files
with
4,783 additions
and
520 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
173 changes: 0 additions & 173 deletions
173
app/src/androidTest/java/org/isoron/uhabits/receivers/PebbleReceiverTest.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
package com.activeandroid; | ||
|
||
/* | ||
* Copyright (C) 2010 Michael Pardo | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import android.content.Context; | ||
import android.database.sqlite.SQLiteDatabase; | ||
|
||
import com.activeandroid.util.Log; | ||
|
||
public final class ActiveAndroid { | ||
////////////////////////////////////////////////////////////////////////////////////// | ||
// PUBLIC METHODS | ||
////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
public static void initialize(Context context) { | ||
initialize(new Configuration.Builder(context).create()); | ||
} | ||
|
||
public static void initialize(Configuration configuration) { | ||
initialize(configuration, false); | ||
} | ||
|
||
public static void initialize(Context context, boolean loggingEnabled) { | ||
initialize(new Configuration.Builder(context).create(), loggingEnabled); | ||
} | ||
|
||
public static void initialize(Configuration configuration, boolean loggingEnabled) { | ||
// Set logging enabled first | ||
setLoggingEnabled(loggingEnabled); | ||
Cache.initialize(configuration); | ||
} | ||
|
||
public static void clearCache() { | ||
Cache.clear(); | ||
} | ||
|
||
public static void dispose() { | ||
Cache.dispose(); | ||
} | ||
|
||
public static void setLoggingEnabled(boolean enabled) { | ||
Log.setEnabled(enabled); | ||
} | ||
|
||
public static SQLiteDatabase getDatabase() { | ||
return Cache.openDatabase(); | ||
} | ||
|
||
public static void beginTransaction() { | ||
Cache.openDatabase().beginTransaction(); | ||
} | ||
|
||
public static void endTransaction() { | ||
Cache.openDatabase().endTransaction(); | ||
} | ||
|
||
public static void setTransactionSuccessful() { | ||
Cache.openDatabase().setTransactionSuccessful(); | ||
} | ||
|
||
public static boolean inTransaction() { | ||
return Cache.openDatabase().inTransaction(); | ||
} | ||
|
||
public static void execSQL(String sql) { | ||
Cache.openDatabase().execSQL(sql); | ||
} | ||
|
||
public static void execSQL(String sql, Object[] bindArgs) { | ||
Cache.openDatabase().execSQL(sql, bindArgs); | ||
} | ||
} |
Oops, something went wrong.