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
@RunWith(MockitoJUnitRunner.class) | |
public final class LoginPresenterTest { | |
private static final String LOGIN_CORRECT = "79990001234"; | |
private static final String LOGIN_WRONG = "79990001111"; | |
private static final String PASSWORD_CORRECT = "123456"; | |
private static final String PASSWORD_WRONG = "111222333"; | |
private static final UserInfo USER_INFO = UserInfo.fromLogin(LOGIN_CORRECT); | |
@Mock |
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
package ru.improvegroup.bookahut.presentation.ui.book | |
import android.os.Bundle | |
import android.widget.TextView | |
import android.widget.Toast | |
import butterknife.BindView | |
import butterknife.ButterKnife | |
import com.arellomobile.mvp.presenter.InjectPresenter | |
import com.arellomobile.mvp.presenter.ProvidePresenter | |
import ru.improvegroup.bookahut.R |
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
package com.alaershov.gradletest; | |
import com.alaershov.domain.Domain; | |
import org.junit.Test; | |
public class DomainUnitTest { | |
@Test | |
public void domain() { | |
new Domain(); |
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
override fun onBackPressed() { | |
val fragment = supportFragmentManager.findFragmentById(R.id.layout_container) | |
if (fragment != null | |
&& fragment is BackButtonListener | |
&& fragment.onBackPressed()) { | |
return | |
} else { | |
super.onBackPressed() | |
} | |
} |
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
dependencies { | |
// ядро библиотеки | |
implementation 'com.github.stephanenicolas.toothpick:toothpick-runtime:3.1.0' | |
// плюшки для Android | |
implementation 'com.github.stephanenicolas.toothpick:smoothie-androidx:3.1.0' | |
// процессор аннотаций для генерации кода | |
annotationProcessor 'com.github.stephanenicolas.toothpick:toothpick-compiler:3.1.0' | |
} |
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 final class UserRepository { | |
private final SharedPreferences sharedPreferences; | |
public UserRepository(SharedPreferences sharedPreferences) { | |
this.sharedPreferences = sharedPreferences; | |
} | |
public User getUser() { | |
// ... |
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 final class UserActivity extends AppCompatActivity { | |
private UserRepository userRepository; | |
@Override | |
protected void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
userRepository = new UserRepository(getSharedPreferences("app.prefs", MODE_PRIVATE)); | |
} | |
} |
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 final class UserRepository { | |
private final SharedPreferences sharedPreferences; | |
@Inject | |
public UserRepository(SharedPreferences sharedPreferences) { | |
this.sharedPreferences = sharedPreferences; | |
} | |
// ... |
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 final class UserActivity extends AppCompatActivity { | |
// поле больше не приватное | |
@Inject | |
UserRepository userRepository; | |
@Override | |
protected void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
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 final class App extends Application { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
Scope appScope = Toothpick.openScope("APP"); | |
} | |
} |
OlderNewer