Skip to content

Instantly share code, notes, and snippets.

Avatar

Avjeet Avjeet

View GitHub Profile
View BroadcastSimulation.java
public class BroadcastSimulator implements ListItemClicked {
private static final int SIZE = 10;
public static final int LOAD_MORE_UP = 45;
private final AdapterBroadcastComments adapter;
private HashMap<Integer, SparseArray<List<BroadcastComment>>> commentMap;
private final Context context;
private final int sessionId;
private Long duration;
private Long startTimeInSec;
private int timer = 0;
View temp.java
class MainActivity : AppCompatActivity(), CacheDataSource.EventListener, TransferListener {
private var player: SimpleExoPlayer? = null
companion object {
// About 10 seconds and 1 meg.
// const val VIDEO_URL = "https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4"
// About 1 minute and 5.3 megs
const val VIDEO_URL = "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"
View activity_sensor_view_graph.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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"
android:id="@+id/data_view_cl"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
View GSoC 2018_Avjeet Singh .md
View data_logger_item.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/data_item_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/logger_card_margin"
app:cardCornerRadius="@dimen/logger_card_corner_rad">
<LinearLayout
View SettingsActivity.java
package io.pslab.activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
@Avjeet
Avjeet / custom_bottomsheet_guide.xml
Created Jun 25, 2018
This gist contains code for layout of bottomsheet guide as used to show information regarding instruments
View custom_bottomsheet_guide.xml
<LinearLayout 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"
android:id="@+id/bottom_sheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/bottom_sheet_side_margin"
android:layout_marginRight="@dimen/bottom_sheet_side_margin"
android:orientation="vertical"
View gist:ebeb66fe4b9bfcf93adc2b477d1c0b27
public class Holder extends RecyclerView.ViewHolder {
public TextView applicationName;
public ImageView applicationIcon;
public Holder(View itemView) {
super(itemView);
this.applicationName = (TextView) itemView.findViewById(R.id.application_name);
this.applicationIcon = (ImageView) itemView.findViewById(R.id.application_icon);
}