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.google.ara.app.manager; | |
import java.util.List; | |
public class NameJoiner { | |
private NameJoiner() { | |
} | |
public static String join(List<String> names, int index, String... separators) { |
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
import android.content.Intent; | |
import android.view.View; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
public class MainActivity extends AppCompatActivity { | |
... | |
public void tomarFoto(View view) { | |
Intent intent = new Intent(this, CameraActivity.class); | |
startActivity(intent); |
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
<manifest ... > | |
<uses-feature android:name="android.hardware.camera" | |
android:required="true" /> | |
... | |
</manifest> |
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
import android.content.Intent; | |
import android.graphics.Bitmap; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import android.os.Environment; | |
import android.provider.MediaStore; | |
import android.support.v7.app.AppCompatActivity; | |
import android.view.View; | |
import android.widget.ImageView; |
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
import android.os.AsyncTask; | |
import android.widget.TextView; | |
public class CameraActivity extends AppCompatActivity { | |
... | |
private TextView progress; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
... |
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 void someMethod() { | |
bus.post(new SomeKindOfEvent(optionalParam1, optionalParam2)); | |
} |
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
@Subscribe | |
public void someAppropriateName(SomeKindOfEvent event) { | |
//Your action here | |
} |
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
//MainActivity.java | |
public class MainActivity extends AppCompatActivity { | |
private MainPresenter presenter; | |
//Simply a singleton of Bus | |
private Bus bus = BusManager.getInstance(); | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main_activity); |
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 MainPresenter { | |
private final MainModel model; | |
private final MainView view; | |
public MainPresenter(MainView view, MainModel model) { | |
this.view = view; | |
this.model = model; | |
} | |
} |
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 MainView { | |
private final Bus bus; | |
private WeakReference<AppCompatActivity> activityRef; | |
public MainView(AppCompatActivityactivity, Bus bus) { | |
activityRef = new WeakReference<>(activity); | |
this.bus = bus; | |
} | |
@Nullable |
OlderNewer