Skip to content

Instantly share code, notes, and snippets.

Avatar

Viventhraa Rao okaybroda

  • Toronto
View GitHub Profile
@okaybroda
okaybroda / ImageViewBaselineAlignTextView.xml
Created Dec 30, 2015
Example to align an ImageView to the baseline of a TextView.
View ImageViewBaselineAlignTextView.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
<ImageView
android:id="@+id/imageViewHello"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/img_star_05"
android:baselineAlignBottom="true"
@okaybroda
okaybroda / WifiStatusIconView.java
Last active Nov 2, 2017
A custom view that changes icons based on current WiFi state. Uses the NetworkEvents and EventBus library.
View WifiStatusIconView.java
import android.content.Context;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.util.AttributeSet;
import android.widget.ImageButton;
import com.github.pwittchen.networkevents.library.BusWrapper;
import com.github.pwittchen.networkevents.library.ConnectivityStatus;
import com.github.pwittchen.networkevents.library.NetworkEvents;
import com.github.pwittchen.networkevents.library.event.ConnectivityChanged;
@okaybroda
okaybroda / NonSlidingViewPager.java
Created Jul 10, 2015
Disable and enable sliding for a ViewPager
View NonSlidingViewPager.java
public class NonSlidingViewPager extends ViewPager {
boolean allowSliding = true;
public NonSlidingViewPager(Context context) {
super(context);
}
public NonSlidingViewPager(Context context, AttributeSet attrs) {
super(context, attrs);