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
public class MyListView extends ListView | |
{ | |
private android.view.ViewGroup.LayoutParams params; | |
private int oldCount = 0; | |
public MyListView(Context context, AttributeSet attrs) | |
{ | |
super(context, attrs); | |
} |
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
public class FirstRecylerAdapter extends RecyclerView.Adapter<FirstRecylerAdapter.MyViewHolder> { | |
private List<Integer> imageList; | |
public class MyViewHolder extends RecyclerView.ViewHolder { | |
public ImageView image; | |
public MyViewHolder(View view) { | |
super(view); | |
image = (ImageView) view.findViewById(R.id.image); |
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"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > | |
<item> | |
<shape android:shape="rectangle" > | |
<gradient | |
android:angle="360" | |
android:centerColor="#dcdcdc" | |
android:endColor="#e7e7e7" | |
android:gradientRadius="360" |
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
// tests | |
compile fileTree(dir: 'libs', include: ['*.jar']) | |
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { | |
exclude group: 'com.android.support', module: 'support-annotations' | |
}) | |
compile 'com.android.support:appcompat-v7:25.3.1' | |
testCompile 'junit:junit:4.12' | |
testCompile "org.mockito:mockito-core:1.10.19" |
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 | |
public void onSensorChanged( SensorEvent event ) | |
{ | |
if ( currentLocation != null ) | |
{ | |
// get accelerometer data | |
if ( event.sensor.getType() == Sensor.TYPE_ACCELEROMETER ) |
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
Uri.parse("file:///android_asset/myfile.mp3") |
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
function User() { | |
this.id=0; | |
this.name=""; | |
this.description=""; | |
this.newDescription=function (newDescriptionData) { | |
this.description=newDescriptionData; | |
}; |
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
public class MainActivity extends AppCompatActivity | |
{ | |
private ResponseReceiver receiver; | |
@Override | |
protected void onCreate( Bundle savedInstanceState ) | |
{ | |
super.onCreate( savedInstanceState ); | |
setContentView( R.layout.activity_main ); |
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
public class CustomFontTextView extends TextView | |
{ | |
public CustomFontTextView(Context context, AttributeSet attrs, int defStyle) { | |
super(context, attrs, defStyle); | |
init(); | |
} | |
public CustomFontTextView(Context context, AttributeSet attrs) { | |
super(context, attrs); |
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
public static class PermissionsExample | |
{ | |
public static void getLocationPermission( AppCompatActivity thisActivity ) | |
{ | |
if ( ActivityCompat.checkSelfPermission( thisActivity, android.Manifest.permission.ACCESS_FINE_LOCATION ) != PackageManager.PERMISSION_GRANTED || ActivityCompat.checkSelfPermission( thisActivity, android.Manifest.permission.ACCESS_COARSE_LOCATION ) != PackageManager.PERMISSION_GRANTED || ActivityCompat.checkSelfPermission( thisActivity, android.Manifest.permission.INTERNET ) != PackageManager.PERMISSION_GRANTED ) | |
{ |