This file contains hidden or 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
GenericRequestBuilder<Uri,InputStream,SVG,PictureDrawable> | |
requestBuilder = Glide.with(context) | |
.using(Glide.buildStreamModelLoader(Uri.class, context), InputStream.class) | |
.from(Uri.class) | |
.as(SVG.class) | |
.transcode(new SvgDrawableTranscoder(), PictureDrawable.class) | |
.sourceEncoder(new StreamEncoder()) | |
.cacheDecoder(new FileToStreamDecoder<SVG>(new SvgDecoder())) | |
.decoder(new SvgDecoder()) | |
.placeholder(R.drawable.svg_image_view_placeholder) |
This file contains hidden or 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 GitRepoRepository(private val netManager: NetManager) { | |
private val localDataSource = GitRepoLocalDataSource() | |
private val remoteDataSource = GitRepoRemoteDataSource() | |
fun getRepositories(): Observable<ArrayList<Repository>> { | |
... | |
} | |
} |
This file contains hidden or 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
import com.google.gson.Gson; | |
import com.google.gson.GsonBuilder; | |
import okhttp3.OkHttpClient; | |
import retrofit2.Retrofit; | |
import retrofit2.converter.gson.GsonConverterFactory; | |
/** | |
* Created by mladenrakonjac on 01/06/16. | |
*/ | |
public class ServiceGenerator { |
This file contains hidden or 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 MainActivity : LifecycleActivity(), RepositoryRecyclerViewAdapter.OnItemClickListener { | |
private lateinit var binding: ActivityMainBinding | |
private val repositoryRecyclerViewAdapter = RepositoryRecyclerViewAdapter(arrayListOf(), this) | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
binding = DataBindingUtil.setContentView(this, R.layout.activity_main) |
This file contains hidden or 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 loginMethod(String name, String password){ | |
if (isEmpty(name)) { | |
editName.setError("Username is empty"); | |
return; | |
} | |
if (isEmpty(password)) { | |
editPasword.setError("Password is empty"); | |
return; | |
} |
This file contains hidden or 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 | |
internal abstract class MainActivityModule { | |
@ContributesAndroidInjector | |
internal abstract fun mainActivity(): MainActivity | |
@Binds | |
@IntoMap | |
@ViewModelKey(MainViewModel::class) | |
abstract fun bindMainViewModel(viewModel: MainViewModel): ViewModel |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="me.mladenrakonjac.modernandroidapp"> | |
... | |
<application | |
android:name=".ModernApplication" | |
...> | |
... |
This file contains hidden or 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 GitRepoRepository(val netManager: NetManager) { | |
val localDataSource = GitRepoLocalDataSource() | |
val remoteDataSource = GitRepoRemoteDataSource() | |
fun getRepositories(onRepositoryReadyCallback: OnRepositoryReadyCallback) { | |
netManager.isConnectedToInternet?.let { | |
if (it) { | |
remoteDataSource.getRepositories(object : OnRepoRemoteReadyCallback { |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<layout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools"> | |
<data> | |
<import type="android.view.View"/> | |
<variable |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<layout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools"> | |
<data> | |
<import type="android.view.View" /> | |
<variable |
NewerOlder