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
void main() { | |
runApp(_SwitchingThemeApp()); | |
} | |
/// Properties that help me keep track of the example being run. | |
bool _useMaterial = false; | |
class _SwitchingThemeApp extends StatefulWidget { | |
@override | |
_SwitchingThemeAppState createState() => _SwitchingThemeAppState(); |
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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using System.Security.Cryptography; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using System.Threading.Tasks; |
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
/* | |
* Copyright (C) 2017 Darel Bitsy | |
* 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, |
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
public void saveCurrentWeatherForCity(final String cityName, final Currently currently) { | |
final SQLiteDatabase writableDatabase = userCitiesDatabase.getWritableDatabase(); | |
final Cursor query = userCitiesDatabase.getReadableDatabase().rawQuery(String.format("SELECT %s FROM %s WHERE %s=\"%s\"", | |
CITY_NAME, CURRENT_TABLE_NAME, CITY_NAME, cityName), null); | |
final ContentValues databaseInsert = new ContentValues(); | |
databaseInsert.put(CITY_NAME, cityName); | |
databaseInsert.put(CURRENT_TIME, currently.getTime()); | |
databaseInsert.put(CURRENT_SUMMARY, currently.getSummary()); |
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
public interface IAuthProvider { | |
public login() {} | |
public logout() {} | |
public singup() {} | |
} | |
public interface IAuthManager { | |
IAuthProvider provider; | |
IAuthManager() {} |
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
/** | |
* Created by Darel Bitsy on 04/04/17. | |
* User sqlite Helper to create and configure the user cities database | |
*/ | |
public class UserCitiesDatabase extends SQLiteOpenHelper { | |
private static final String DB_NAME = "user_city_list"; | |
private static final int VERSION = 1; |
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
protected void shareScreenShot() throws IOException { | |
final Intent shareIntent = new Intent(Intent.ACTION_SEND); | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | |
shareIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT); | |
} else { | |
shareIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); | |
shareIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); | |
} | |
shareIntent.setType("image/jpeg"); |