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
| /** | |
| * * <ul> | |
| * <li>FORMAT_SHOW_TIME</li> | |
| * <li>FORMAT_SHOW_WEEKDAY</li> | |
| * <li>FORMAT_SHOW_YEAR</li> | |
| * <li>FORMAT_SHOW_DATE</li> | |
| * <li>FORMAT_NO_MONTH_DAY</li> | |
| * <li>FORMAT_12HOUR</li> | |
| * <li>FORMAT_24HOUR</li> | |
| * <li>FORMAT_CAP_AMPM</li> |
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 kotlinx.android.synthetic.main.activity_details.toolbar | |
| .... | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setContentView(R.layout.activity_details) | |
| setSupportActionBar(toolbar) // at xml | |
| supportActionBar?.setDisplayHomeAsUpEnabled(true) | |
| .... |
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"?> | |
| <!-- | |
| Duration = 1 means that one rotation will be done in 1 second. leave it. | |
| If you want to speed up the rotation, increase duration value. | |
| in example 1080 shows three times faster revolution. | |
| make the value multiply of 360, or the ring animates clunky | |
| --> | |
| <rotate xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:fromDegrees="720" |
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
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setContentView(R.layout.activity_detailed) | |
| var url = intent.getStringExtra("link") | |
| // set same transition name | |
| detailImg.transitionName = url | |
| detailImg.setOnClickListener { | |
| finishAfterTransition() | |
| } |
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
| fun setRangeChangeListener(listener: (Int, Int) -> Unit) { | |
| rangeChangedListener = object : RangeChangedListener { | |
| override fun onRangeChanged(left: Int, | |
| right: Int) = listener(left, right) | |
| } | |
| } |
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"?> | |
| <shape xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:shape="rectangle"> | |
| <!-- other shapes are oval, line ,ring --> | |
| <corners | |
| android:radius="100dp" | |
| android:bottomRightRadius="20dp" /> | |
| <!-- Use these attributes for the rest of the corners | |
| android:topLeftRadius="integer" |
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 android.content.Context | |
| import android.util.AttributeSet | |
| import android.view.LayoutInflater | |
| import au.sj.owl.uimock.R | |
| import com.jakewharton.rxbinding2.InitialValueObservable | |
| import com.jakewharton.rxbinding2.view.RxView | |
| import com.jakewharton.rxbinding2.widget.RxTextView | |
| import io.reactivex.Observable | |
| import kotlinx.android.synthetic.main.w_serchview.view.sv_filters | |
| import kotlinx.android.synthetic.main.w_serchview.view.sv_search |
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 android.annotation.TargetApi | |
| import android.content.Context | |
| import android.graphics.Outline | |
| import android.os.Build | |
| import android.support.constraint.ConstraintLayout | |
| import android.util.AttributeSet | |
| import android.view.View | |
| import android.view.ViewOutlineProvider | |
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
| private var mSectionsPagerAdapter: SectionsPagerAdapter? = null | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| ... | |
| mSectionsPagerAdapter = SectionsPagerAdapter(supportFragmentManager) | |
| container.adapter = mSectionsPagerAdapter | |
| tl_9.setViewPager(container) | |
| nav_view.setNavigationItemSelectedListener(this) |
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
| override fun onCreateOptionsMenu(menu: Menu): Boolean { | |
| // Inflate the menu; this adds items to the action bar if it is present. | |
| menuInflater.inflate(R.menu.home, menu) | |
| return true | |
| } | |
| override fun onOptionsItemSelected(item: MenuItem): Boolean { | |
| // Handle action bar item clicks here. The action bar will | |
| // automatically handle clicks on the Home/Up button, so long | |
| // as you specify a parent activity in AndroidManifest.xml. |