Skip to content

Instantly share code, notes, and snippets.

package com.teatime.americano.ui.main
...
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.app_bar_main.*
import kotlinx.android.synthetic.main.nav_header_main.*
...
class MainActivity : BaseActivity(), NavigationView.OnNavigationItemSelectedListener, MainView, StampSelectListener {
...
override fun initStampLayout() {
nav_view.post {
presenter.updateMemoState()
stamp_recycler.layoutManager = gridLayoutManager
stamp_recycler.adapter = stampAdapter
stampAdapter.setListener(this)
all_stamp.setOnClickListener({
//null 이 올 수도 있는 경우
override fun updateProfileCover(cover: String?) {
if(cover.isNullOrEmpty()){
Glide.with(this).load(R.drawable.photo_bg).centerCrop().thumbnail(0.1f).into(profile_setting_cover_img)
} else {
Glide.with(this).load(cover).centerCrop().thumbnail(0.1f).into(profile_setting_cover_img)
}
}
//null이 절대 올 수 없는 경우
val actionBar = supportActionBar
actionBar?.let {
actionBar.setDisplayHomeAsUpEnabled(true)
actionBar.setHomeButtonEnabled(true)
actionBar.setDisplayShowTitleEnabled(false) }
class FeedbackPresenterImpl(val activity: FeedbackActivity, val view: FeedbackView) : FeedbackPresenter {
override fun sendEmail() {
....
}
}
class MyView : View {
constructor(ctx: Context) : super(ctx) {
}
constructor(ctx: Context, attrs: AttributeSet) : super(ctx, attrs) {
}
}
public class Singleton {
private static Singleton singleton;
private Singleton(){
}
public Singleton getInstance(){
if(singleton == null)
singleton = new Singleton();
return singleton;
object MemoManager {
....
}
package com.teatime.americano.decorators
....
/**
* Created by myeongin on 14. 12. 13..
*/
class GalleryDecoration(private val context: Context, orientation: Int) : RecyclerView.ItemDecoration() {
....
package com.teatime.americano.decorators
...
/**
* Created by myeongin on 14. 12. 13..
*/
class GalleryDecoration(private val context: Context, orientation: Int) : RecyclerView.ItemDecoration() {
...