Skip to content

Instantly share code, notes, and snippets.

View adapter_item_width.kotlin
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val holder = ViewHolder(
LayoutInflater.from(parent.context)
.inflate(R.layout.list_item_appointment, parent, false)
)
if (!itemWidthMatchParent && items.size > 1) {
val params = holder.itemView.layoutParams
params.width =
parent.measuredWidth - (4 * parent.context.resources.getDimensionPixelSize(R.dimen.margin_10))
@TOrnelas
TOrnelas / response.json
Created Mar 31, 2020
Competitons response - Gjesteboka production
View response.json
[{
"id": 59,
"name": "FRISKUS Tresfjord IL 2016",
"created_at": "2015-10-19T10:17:28+02:00",
"created_by": "organization",
"start_date": "2015-10-16T00:00:00+02:00",
"end_date": "2016-10-15T23:59:00+02:00",
"admission_price": 15000,
"finished": true,
"organization_id": 7,
View progressbar.java
progressBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
// Quando alguem acaba a interagir com a PB
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
// Quando alguem comeca de interagir com a PB
View OpenStore.java
String appPackageName = "com.travelcentral24.yougoto";
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
} catch (android.content.ActivityNotFoundException anfe) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName)));
}
View gist:4424d8892aac72c110cb19daf0392791
@Override
public BottomMenuItemViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
final View itemLayoutView = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_bottom_menu,
parent, false);
BottomMenuItemViewHolder viewHolder = new BottomMenuItemViewHolder(itemLayoutView);
DisplayMetrics displaymetrics = new DisplayMetrics();
final WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
View error_adding_download_lib
07-17 10:01:52.404 7748-7748/? E/Zygote: v2
07-17 10:01:52.404 7748-7748/? I/libpersona: KNOX_SDCARD checking this for 10208
07-17 10:01:52.404 7748-7748/? I/libpersona: KNOX_SDCARD not a persona
07-17 10:01:52.414 7748-7748/? W/SELinux: Function: selinux_compare_spd_ram, index[1], priority [2], priority version is VE=SEPF_SECMOBILE_6.0.1_0030
07-17 10:01:52.414 7748-7748/? W/SELinux: SELinux: seapp_context_lookup: seinfo=default, level=s0:c512,c768, pkgname=uk.tva.androiddownloadlibrarytest
07-17 10:01:52.414 7748-7748/? I/art: Late-enabling -Xcheck:jni
07-17 10:01:52.474 7748-7748/? D/TimaKeyStoreProvider: TimaSignature is unavailable
07-17 10:01:52.474 7748-7748/? D/ActivityThread: Added TimaKeyStore provider
07-17 10:01:52.634 7748-7748/uk.tva.androiddownloadlibrarytest W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,-div,-atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --ru
View layouts_exemple_1
{
"screen_type": "list",
"layouts": [
{
"layout_type": "carousel",
"order": 0,
"rows": 1,
"columns": 2.5,
"number_max_elements": 10,
"orientation": "horizontal",
View gist:b221ef5972e914559376e7fb6cfbc23e
private void playNextVideo(){
for (int i = 0; i < contentArrayList.size(); i++){
if (contentArrayList.get(i).isPlaying()){
if (i == contentArrayList.size() - 1)
finish();
url = "https://cdnapisec.kaltura.com/p/309/sp/0/playManifest/entryId/" +
contentArrayList.get(i + 1).getIdKaltura()
+"/format/applehttp/protocol/http/flavorParamId/301971/manifest.m3u8";