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
private final BroadcastReceiver mBackgroundReceiver = new BroadcastReceiver() { | |
public void onReceive(Context paramAnonymousContext, Intent paramAnonymousIntent) { | |
if (paramAnonymousIntent.hasExtra("card_location")) { | |
mListener.onCardLocation( | |
Rect.unflattenFromString(paramAnonymousIntent.getStringExtra("card_location"))); | |
} | |
if (paramAnonymousIntent.hasExtra("card_progress_enabled")) { | |
mListener.onCardProgressEnabled(paramAnonymousIntent.getBooleanExtra("card_progress_enabled", false)); | |
} | |
if (paramAnonymousIntent.hasExtra("card_progress")) { |
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
IntentFilter timeTickIntentFilter = new IntentFilter("com.google.android.wearable.home.action.WEARABLE_TIME_TICK"); | |
listener.registerReceiver(mTimeTickReceiver, timeTickIntentFilter); | |
public final BroadcastReceiver mTimeTickReceiver = new BroadcastReceiver() { | |
public void onReceive(Context context, Intent intent) { | |
//ontick | |
} | |
}; |
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 WatchFaceAluminum | |
extends WatchFace | |
{ | |
protected WatchFaceStyle buildStyle() | |
{ | |
WatchFaceStyle.Builder localBuilder = WatchFaceStyle.Builder.forActivity(this).setCardPeekMode(1).setPeekOpacityMode(1).setCardProgressMode(0).setBackgroundVisibility(0).setViewProtection(0).setShowSystemUiTime(false); | |
if (isRound()) { | |
localBuilder.setHotwordIndicatorGravity(81).setStatusBarGravity(49); | |
} | |
for (;;) |
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 java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import android.content.Context; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
import android.view.ViewGroup; |
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 final class MapStyleManager implements GoogleMap.OnCameraMoveListener { | |
private final Context context; | |
private final GoogleMap map; | |
private final GoogleMap.OnCameraMoveListener onCameraMoveListener; | |
private final TreeMap<Float, Integer> styleMap = new TreeMap<>(); | |
@RawRes | |
private int currentMapStyleRes = 0; |
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
DaggerApplicationComponent.builder().context(applicationContext).build().inject(this); |
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
<!-- Prevents TouchWiz from surrounding your app icon in a frame --> | |
<!-- Add to your manifest inside the application tag --> | |
<meta-data | |
android:name="com.samsung.android.icon_container.has_icon_container" | |
android:value="true"/> |
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
class MapsAdapter(context: Context, private val markers: List<MarkerData>) : GoogleMapMeAdapter(context) { | |
fun onCreateAnnotation(factory: AnnotationFactory, position: Int, annotationType: Int): MapAnnotation { | |
val item = this.markers[position] | |
return factory.createMarker(item.getLatLng(), null, item.getTitle()) | |
} | |
fun onBindAnnotation(annotation: MapAnnotation, position: Int, payload: Any) { | |
if (annotation is MarkerAnnotation) { | |
val item = this.markers[position] |
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
val adapter: MapMeAdapter = GoogleMapMeAdapter(context, items) | |
adapter.setOnAnnotationClickListener(this) | |
mapView.getMapAsync { googleMap -> | |
//Attach the adapter to the map view once it's initialized | |
adapter.attach(mapView, googleMap) | |
} |
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
// add new data and tell the adapter about it | |
items.addAll(myData) | |
adapter.notifyDataSetChanged() | |
// or with DiffUtil | |
val diff = DiffUtil.calculateDiff(myDiffCallback) | |
diff.dispatchUpdatesTo(adapter) |
OlderNewer