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
"scripts" : { | |
"android-prod": "react-native run-android --variant=prodDebug --appId=com.your.coolapp", | |
"android-stag": "react-native run-android --variant=stagDebug --appId=com.your.coolapp.stag", | |
"android-dev": "react-native run-android --variant=devDebug --appId=com.your.coolapp.dev", | |
} |
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
<resources> | |
<string name="app_name">@string/APP_DISPLAY_NAME</string> | |
</resources> |
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
android { | |
// other snippet | |
flavorDimensions "default" | |
productFlavors { | |
prod { | |
resValue "string", "build_config_package", "com.your.coolapp" | |
} |
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
ENV=development | |
BASE_URL=https://dev.yourcool.app/api/v1 | |
APP_DISPLAY_NAME = "Yourcool App Dev" | |
API_KEY=som3r4ndomK3y | |
SOME_3RDPARTY_API_KEY=s0m3r4nd0mK3y |
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
project.ext.envConfigFiles = [ | |
dev: ".env.development", | |
stag: ".env.staging", | |
prod: ".env.production" | |
] | |
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle" | |
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
if (isIpAddressDifferentWithLastRecorded(latestIpAddress)) { | |
Log.d( | |
WorkManagerHelper.TAG, | |
"Different IP Address ($latestIpAddress}." | |
) | |
insertNewRecordToDb(latestIpAddress) | |
} else { | |
if (connManager.getNetworkClass() == ConnectionManager.NETWORK_WIFI) { | |
// check if its on wifi more than one hour |
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
class EventListActivity : BaseActivity(){ | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_event_list) | |
val viewModel = ViewModelProviders.of(this).get(EventListViewModel::class.java) | |
// setup recyclerview | |
rvListOfKajian.layoutManager = LinearLayoutManager(this) |
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
class EventListViewModel : ViewModel(){ | |
val eventList = MutableLiveData<List<Event>>() | |
init { | |
eventList.postValue(arrayListOf(Event("Google IO 2018"), | |
Event("Droidcon London 2018"), | |
Event("GOTO Berlin 2018"))) | |
} |
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
class EventListActivity : BaseActivity(){ | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_event_list) | |
val viewModel = ViewModelProviders.of(this).get(EventListViewModel::class.java) | |
rvListOfEvent.layoutManager = LinearLayoutManager(this) | |
val adapter = EventListAdapter() |
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
class EventListViewModel : ViewModel(){ | |
val eventList = arrayListOf(Event("Google IO 2018"), | |
Event("Droidcon London 2018"), | |
Event("GOTO Berlin 2018")) | |
} |
NewerOlder