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
import java.util.TimeZone | |
import android.text.format.Time | |
import java.text.SimpleDateFormat | |
import java.text.DateFormat | |
/** | |
* Created by loop on 24/11/14. | |
*/ | |
/** |
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
trait GmailAuthenticator : ActionBarActivity { | |
companion object { | |
val TAG = javaClass<GmailAuthenticator>().getName() | |
val PLAY_SERVICES_RESOLUTION_REQUEST = 9000 | |
val REQUEST_CODE_PICK_ACCOUNT = 1000 | |
val REQUEST_CODE_RECOVER_FROM_PLAY_SERVICES_ERROR = 1001 | |
val AUDIENCE = "audience:...." | |
} |
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
val color = getResources().getString(R.color.some_color).replace("#ff", "#") | |
val terms = getString(R.string.register_terms, color) | |
termsText.setText(Html.fromHtml(terms)) |
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
@Nullable | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
SwipeRefreshLayout rv = (SwipeRefreshLayout) inflater.inflate( | |
R.layout.fragment_cheese_list, container, false); | |
rv.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { | |
@Override | |
public void onRefresh() { | |
} |
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 MySwipeLayout : SwipeRefreshLayout { | |
public constructor(context: Context) : super(context) | |
public constructor(context: Context, attrs: AttributeSet) : super(context, attrs) | |
var appBarLayout: AppBarLayout? = null | |
override fun onAttachedToWindow() { | |
super<SwipeRefreshLayout>.onAttachedToWindow() |
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
<?xml version="1.0" encoding="utf-8"?> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item android:state_pressed="true"> | |
<layer-list> | |
<!-- Drop Shadow Stack --> | |
<item> | |
<shape> | |
<padding | |
android:bottom="1dp" |
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
import android.graphics.Canvas | |
import android.graphics.Color | |
import android.graphics.Paint | |
import android.graphics.Rect | |
import android.graphics.drawable.GradientDrawable | |
import android.text.Layout | |
import android.text.style.LeadingMarginSpan | |
class FadeLineSpan(val fadingLine: Int, color: Int) : LeadingMarginSpan.LeadingMarginSpan2 { |
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 AdItemHolder(item: View) : BaseHolder(item) { | |
private val adLabel = item.findViewById<View>(R.id.adlabel) | |
private val adContent = item.findViewById<View>(R.id.adcontent) | |
private val labelElevation = item.resources.getDimension(R.dimen.cardview_default_elevation) | |
init { | |
item.viewTreeObserver.addOnScrollChangedListener { | |
val offset = -item.top.toFloat() | |
adLabel.translationY = Math.max(offset, 0f) |
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
{ | |
"articles": [], | |
"links": { | |
"next": "/articles?sort=latest&offset=15&articleOffset=10&limit=10", | |
"self": "/articles?sort=latest" | |
} | |
} |
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
@Composable | |
fun SimpleList() { | |
Column { | |
Text("First item") | |
Text("Second item") | |
for (i in 0..10) { | |
Text("Next $i item") | |
} | |
} | |
} |
OlderNewer