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
package ru.sunsoft.freeme.adapters; | |
import android.content.Context; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.ArrayAdapter; | |
import org.jetbrains.annotations.NotNull; |
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 Constants { | |
public static enum MembershipType { | |
PATIENT(1, "Patient"), COMPANY(2, "Company"), PROVIDER(3, "Provider"); | |
public final int code; | |
public final String name; | |
MembershipType(int codeOfType, String name) { | |
this.code = codeOfType; |
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 EditContactFragment extends Fragment { | |
// ... | |
public static EditContactFragment newInstance(Contact contact){ | |
EditContactFragment fragment = new EditContactFragment(); | |
Bundle contactInfo = new Bundle(); | |
contactInfo.putSerializable(Constants.BUNDLE_CONTACT, contact); | |
fragment.setArguments(contactInfo); | |
return fragment; | |
} |
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 MainActivityTest extends ActivityInstrumentationTestCase2<MainActivity> { | |
private Solo solo; | |
public MainActivityTest() { | |
super(MainActivity.class); | |
} | |
public void setUp() throws Exception { |
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
@Config(emulateSdk = 18) | |
@RunWith(RobolectricTestRunner.class) | |
public class FileIconHelperTest { | |
@Test | |
public void testGetExtension() throws Exception { | |
assertThat(getExtension("image/jpeg")).isEqualTo("jpg"); | |
assertThat(getExtension("video/avi")).isEqualTo("avi"); | |
assertThat(getExtension("superpuper/file")).isEqualTo(""); | |
} |
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
apply plugin: 'com.android.application' | |
apply plugin: 'robolectric' | |
dependencies { | |
compile 'com.android.support:support-v4:20.+' | |
compile 'com.squareup.picasso:picasso:2.3.2' | |
compile 'com.squareup.okhttp:okhttp:2.0.0' | |
compile 'com.squareup.okhttp:okhttp-urlconnection:+' | |
compile 'com.google.zxing:core:2.0' | |
compile 'com.actionbarsherlock:actionbarsherlock:4.+@aar' |
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
package com.aclgrc.fragments; | |
import android.app.Fragment; | |
import android.os.Bundle; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.ListView; | |
import com.aclgrc.adapters.ObjectivesArrayAdapter; |
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 List<SomeObject> someFunc(List<SomeObject> someObjs){ | |
List<SomeObj> objects = new List<SomeObject>(); | |
objects = someObjs; | |
for(SomeObj obj : objects){ | |
obj.field1 = obj.field1; | |
obj.field2 = obj.field2; | |
} | |
return objects; | |
} |
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 Wrapper<T> { | |
@JsonCreator | |
public Wrapper(){} | |
protected Map<String, T> map = new HashMap<>(); | |
@JsonAnySetter public void set(String name, T t) { | |
map.put(name, t); | |
} |
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 SignUpScreen extends BaseFragment{ | |
private void signUp(RegistrationInfo regInfo) { | |
startProgressAnimation(); | |
bind(api.registerWith(regInfo))) | |
.flatMap(registerResponse -> api.getToken("password", userName, password, Consts.CLIENT_ID, Consts.CLIENT_SECRET)) | |
.flatMap(token -> { | |
User.saveTokens(token); | |
return api.getProfileInfo(Consts.SELF); | |
}) |