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
@Module | |
object MessageModule { | |
@AppScope | |
@Provides | |
@JvmStatic | |
fun messageModule(...): MessageRepository { | |
return MessageRepository(...) | |
} | |
} |
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
@AppScope | |
@Component(modules = [DataModule::class, WhateverModule::class, ..]) | |
interface AppComponentImpl : AppComponent |
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
interface AppComponent { | |
val messageRepository: MessageRepository | |
val conversationRepository: ConversationRepository | |
} | |
interface AppComponentProvider { | |
fun appComponent(): AppComponent | |
} |
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 App : Application(), AppComponentProvider { | |
private lateinit var _appComponent: AppComponentImpl | |
override fun onCreate() { | |
super.onCreate() | |
_appComponent = DaggerAppComponentImpl.factory().create() | |
} | |
override fun appComponent(): AppComponent { |
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
@Feature1ControllerScope | |
@Component(dependencies = [AppComponent::class], modules = [Feature1Module::class]) | |
interface Feature1ControllerComponent { | |
val viewModel: InviteViewModel | |
@Component.Factory | |
interface Factory { | |
fun create( | |
appComponent: AppComponent | |
): Feature1ControllerComponent |
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 Feature1Controller : Controller { | |
override fun onCreateViewModel(): Feature1ViewModel { | |
val appComponent = (activity.applicationContext as AppComponentProvider).appComponent() | |
return DaggerFeature1ControllerComponent.factory().create(appComponent).viewModel | |
} | |
} |
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 Feature1Controller : Controller { | |
override fun onCreateViewModel(): Feature1ViewModel { | |
val appComponent = (activity.applicationContext as AppComponentProvider).appComponent() | |
return DaggerFeature1ControllerComponent.factory().create(appComponent).viewModel | |
} | |
} |
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
2018-11-02 05:14:15.785 16674-16742/com.icewarp.instantmessanger E/Default: Title: pjsua_vid_dev_set_setting(dev_id, PJMEDIA_VID_DEV_CAP_ORIENTATION, &orient, keep) | |
Code: 520008 | |
Description: Invalid or unsupported video capability (PJMEDIA_EVID_INVCAP) | |
Location: ../src/pjsua2/media.cpp:1498 | |
java.lang.Exception: Title: pjsua_vid_dev_set_setting(dev_id, PJMEDIA_VID_DEV_CAP_ORIENTATION, &orient, keep) | |
Code: 520008 | |
Description: Invalid or unsupported video capability (PJMEDIA_EVID_INVCAP) | |
Location: ../src/pjsua2/media.cpp:1498 | |
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
sudo apt-get install openjdk-8-jdk | |
wget https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip -O sdk_tools.zip | |
unzip sdk_tools.zip -d android_sdk | |
echo y | android_sdk/tools/bin/sdkmanager "build-tools;27.0.3" | |
echo y | android_sdk/tools/bin/sdkmanager "platforms;android-P" | |
export ANDROID_HOME=$(pwd)/android_sdk | |
git clone https://github.com/ursusursus/RoomTest.git | |
cd RoomTest | |
chmod +x gradlew |
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 class MainActivity extends FragmentActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
RestService.foo(this, "parameterCisloJedna", new Callback() { | |
@Override |
NewerOlder