-
Notifications
You must be signed in to change notification settings - Fork 451
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- This is mainly a bugfix release. - Fixed (#109): Documentation Bug. - Fixed (#117): Crash after update to 0.8 version. - SDK demos are now using Material Design (h/t @RingoMckraken).
- Loading branch information
Showing
21 changed files
with
109 additions
and
138 deletions.
There are no files selected for viewing
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
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
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
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
28 changes: 28 additions & 0 deletions
28
Demos/src/main/java/com/estimote/examples/demos/activities/BaseActivity.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.estimote.examples.demos.activities; | ||
|
||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.support.v7.widget.Toolbar; | ||
import android.view.View; | ||
import com.estimote.examples.demos.R; | ||
|
||
public abstract class BaseActivity extends AppCompatActivity { | ||
|
||
protected Toolbar toolbar; | ||
|
||
protected abstract int getLayoutResId(); | ||
|
||
@Override protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(getLayoutResId()); | ||
|
||
toolbar = (Toolbar) findViewById(R.id.toolbar); | ||
toolbar.setNavigationIcon(R.drawable.ic_action_navigation_arrow_back); | ||
toolbar.setTitle(getTitle()); | ||
toolbar.setNavigationOnClickListener(new View.OnClickListener() { | ||
@Override public void onClick(View v) { | ||
onBackPressed(); | ||
} | ||
}); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
* | ||
* @author [email protected] (Wiktor Gworek) | ||
*/ | ||
public class CharacteristicsDemoActivity extends AppCompatActivity { | ||
public class CharacteristicsDemoActivity extends BaseActivity { | ||
|
||
private Beacon beacon; | ||
private BeaconConnection connection; | ||
|
@@ -28,19 +28,13 @@ public class CharacteristicsDemoActivity extends AppCompatActivity { | |
private EditText minorEditView; | ||
private View afterConnectedView; | ||
|
||
@Override protected int getLayoutResId() { | ||
return R.layout.characteristics_demo; | ||
} | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.characteristics_demo); | ||
|
||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); | ||
toolbar.setNavigationIcon(R.drawable.ic_action_navigation_arrow_back); | ||
toolbar.setTitle(getTitle()); | ||
toolbar.setNavigationOnClickListener(new View.OnClickListener() { | ||
@Override public void onClick(View v) { | ||
onBackPressed(); | ||
} | ||
}); | ||
|
||
statusView = (TextView) findViewById(R.id.status); | ||
beaconDetailsView = (TextView) findViewById(R.id.beacon_details); | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
* | ||
* @author [email protected] (Wiktor Gworek) | ||
*/ | ||
public class DistanceBeaconActivity extends AppCompatActivity { | ||
public class DistanceBeaconActivity extends BaseActivity { | ||
|
||
private static final String TAG = DistanceBeaconActivity.class.getSimpleName(); | ||
|
||
|
@@ -36,19 +36,13 @@ public class DistanceBeaconActivity extends AppCompatActivity { | |
private int startY = -1; | ||
private int segmentLength = -1; | ||
|
||
@Override protected int getLayoutResId() { | ||
return R.layout.distance_view; | ||
} | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.distance_view); | ||
|
||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); | ||
toolbar.setNavigationIcon(R.drawable.ic_action_navigation_arrow_back); | ||
toolbar.setTitle(getTitle()); | ||
toolbar.setNavigationOnClickListener(new View.OnClickListener() { | ||
@Override public void onClick(View v) { | ||
onBackPressed(); | ||
} | ||
}); | ||
|
||
dotView = findViewById(R.id.dot); | ||
beacon = getIntent().getParcelableExtra(ListBeaconsActivity.EXTRAS_BEACON); | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
package com.estimote.examples.demos.activities; | ||
|
||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.support.v7.widget.Toolbar; | ||
import android.view.View; | ||
import android.widget.EditText; | ||
import android.widget.TextView; | ||
|
@@ -19,7 +17,7 @@ | |
* | ||
* @author [email protected] (Wiktor Gworek) | ||
*/ | ||
public class EddystonesDemoActivity extends AppCompatActivity { | ||
public class EddystoneDemoActivity extends BaseActivity { | ||
|
||
private Eddystone eddystone; | ||
private BeaconConnection connection; | ||
|
@@ -29,26 +27,20 @@ public class EddystonesDemoActivity extends AppCompatActivity { | |
private EditText eddystoneEditView; | ||
private View afterConnectedView; | ||
|
||
@Override protected int getLayoutResId() { | ||
return R.layout.eddystones_demo; | ||
} | ||
|
||
@Override protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.eddystones_demo); | ||
|
||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); | ||
toolbar.setNavigationIcon(R.drawable.ic_action_navigation_arrow_back); | ||
toolbar.setTitle(getTitle()); | ||
toolbar.setNavigationOnClickListener(new View.OnClickListener() { | ||
@Override public void onClick(View v) { | ||
onBackPressed(); | ||
} | ||
}); | ||
|
||
statusView = (TextView) findViewById(R.id.status); | ||
eddystoneDetailsView = (TextView) findViewById(R.id.eddystone_details); | ||
TextView eddystoneIdLabel = (TextView) findViewById(R.id.eddystone_id_label); | ||
afterConnectedView = findViewById(R.id.after_connected); | ||
eddystoneEditView = (EditText) findViewById(R.id.eddystone_id); | ||
|
||
eddystone = getIntent().getParcelableExtra(ListEddystonesActivity.EXTRAS_EDDYSTONE); | ||
eddystone = getIntent().getParcelableExtra(ListEddystoneActivity.EXTRAS_EDDYSTONE); | ||
connection = new BeaconConnection(this, eddystone.macAddress, createConnectionCallback()); | ||
|
||
eddystoneIdLabel.setText(eddystone.isUrl() ? "Eddystone's url" : "Eddystone's namespace"); | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,6 @@ | |
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.os.RemoteException; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.support.v7.widget.Toolbar; | ||
import android.util.Log; | ||
import android.view.View; | ||
import android.widget.AdapterView; | ||
|
@@ -26,7 +24,7 @@ | |
* | ||
* @author [email protected] (Wiktor Gworek) | ||
*/ | ||
public class ListBeaconsActivity extends AppCompatActivity { | ||
public class ListBeaconsActivity extends BaseActivity { | ||
|
||
private static final String TAG = ListBeaconsActivity.class.getSimpleName(); | ||
|
||
|
@@ -38,20 +36,13 @@ public class ListBeaconsActivity extends AppCompatActivity { | |
|
||
private BeaconManager beaconManager; | ||
private BeaconListAdapter adapter; | ||
private Toolbar toolbar; | ||
|
||
@Override protected int getLayoutResId() { | ||
return R.layout.main; | ||
} | ||
|
||
@Override protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.main); | ||
|
||
toolbar = (Toolbar) findViewById(R.id.toolbar); | ||
toolbar.setNavigationIcon(R.drawable.ic_action_navigation_arrow_back); | ||
toolbar.setTitle(getTitle()); | ||
toolbar.setNavigationOnClickListener(new View.OnClickListener() { | ||
@Override public void onClick(View v) { | ||
onBackPressed(); | ||
} | ||
}); | ||
|
||
// Configure device list. | ||
adapter = new BeaconListAdapter(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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,6 @@ | |
import android.bluetooth.BluetoothAdapter; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.support.v7.widget.Toolbar; | ||
import android.util.Log; | ||
import android.view.View; | ||
import android.widget.AdapterView; | ||
|
@@ -24,9 +22,9 @@ | |
* | ||
* @author [email protected] (Wiktor Gworek) | ||
*/ | ||
public class ListEddystonesActivity extends AppCompatActivity { | ||
public class ListEddystoneActivity extends BaseActivity { | ||
|
||
private static final String TAG = ListEddystonesActivity.class.getSimpleName(); | ||
private static final String TAG = ListEddystoneActivity.class.getSimpleName(); | ||
|
||
public static final String EXTRAS_TARGET_ACTIVITY = "extrasTargetActivity"; | ||
public static final String EXTRAS_EDDYSTONE = "extrasEddystone"; | ||
|
@@ -35,20 +33,13 @@ public class ListEddystonesActivity extends AppCompatActivity { | |
|
||
private BeaconManager beaconManager; | ||
private EddystonesListAdapter adapter; | ||
private Toolbar toolbar; | ||
|
||
@Override protected int getLayoutResId() { | ||
return R.layout.main; | ||
} | ||
|
||
@Override protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.main); | ||
|
||
toolbar = (Toolbar) findViewById(R.id.toolbar); | ||
toolbar.setNavigationIcon(R.drawable.ic_action_navigation_arrow_back); | ||
toolbar.setTitle(getTitle()); | ||
toolbar.setNavigationOnClickListener(new View.OnClickListener() { | ||
@Override public void onClick(View v) { | ||
onBackPressed(); | ||
} | ||
}); | ||
|
||
// Configure device list. | ||
adapter = new EddystonesListAdapter(this); | ||
|
@@ -106,7 +97,7 @@ private void connectToService() { | |
|
||
beaconManager.setEddystoneListener(new BeaconManager.EddystoneListener() { | ||
@Override public void onEddystonesFound(List<Eddystone> eddystones) { | ||
toolbar.setSubtitle("Found eddystones: " + eddystones.size()); | ||
toolbar.setSubtitle("Found beacons with Eddystone protocol: " + eddystones.size()); | ||
adapter.replaceWith(eddystones); | ||
} | ||
}); | ||
|
@@ -124,7 +115,7 @@ private AdapterView.OnItemClickListener createOnItemClickListener() { | |
if (getIntent().getStringExtra(EXTRAS_TARGET_ACTIVITY) != null) { | ||
try { | ||
Class<?> clazz = Class.forName(getIntent().getStringExtra(EXTRAS_TARGET_ACTIVITY)); | ||
Intent intent = new Intent(ListEddystonesActivity.this, clazz); | ||
Intent intent = new Intent(ListEddystoneActivity.this, clazz); | ||
intent.putExtra(EXTRAS_EDDYSTONE, adapter.getItem(position)); | ||
startActivity(intent); | ||
} catch (ClassNotFoundException e) { | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ | |
* | ||
* @author [email protected] (Wiktor Gworek) | ||
*/ | ||
public class ListNearablesActivity extends AppCompatActivity { | ||
public class ListNearablesActivity extends BaseActivity { | ||
|
||
private static final String TAG = ListNearablesActivity.class.getSimpleName(); | ||
|
||
|
@@ -35,22 +35,15 @@ public class ListNearablesActivity extends AppCompatActivity { | |
|
||
private BeaconManager beaconManager; | ||
private NearableListAdapter adapter; | ||
private Toolbar toolbar; | ||
|
||
@Override protected int getLayoutResId() { | ||
return R.layout.main; | ||
} | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.main); | ||
|
||
toolbar = (Toolbar) findViewById(R.id.toolbar); | ||
toolbar.setNavigationIcon(R.drawable.ic_action_navigation_arrow_back); | ||
toolbar.setTitle(getTitle()); | ||
toolbar.setNavigationOnClickListener(new View.OnClickListener() { | ||
@Override public void onClick(View v) { | ||
onBackPressed(); | ||
} | ||
}); | ||
|
||
// Configure device list. | ||
adapter = new NearableListAdapter(this); | ||
ListView list = (ListView) findViewById(R.id.device_list); | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,26 +15,20 @@ | |
* | ||
* @author [email protected] (Wiktor Gworek) | ||
*/ | ||
public class NearablesDemoActivity extends AppCompatActivity { | ||
public class NearablesDemoActivity extends BaseActivity { | ||
|
||
private static final String TAG = NearablesDemoActivity.class.getSimpleName(); | ||
|
||
private Nearable currentNearable; | ||
private BeaconManager beaconManager; | ||
|
||
@Override protected int getLayoutResId() { | ||
return R.layout.nearable_demo; | ||
} | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.nearable_demo); | ||
|
||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); | ||
toolbar.setNavigationIcon(R.drawable.ic_action_navigation_arrow_back); | ||
toolbar.setTitle(getTitle()); | ||
toolbar.setNavigationOnClickListener(new View.OnClickListener() { | ||
@Override public void onClick(View v) { | ||
onBackPressed(); | ||
} | ||
}); | ||
|
||
currentNearable = getIntent().getExtras().getParcelable(ListNearablesActivity.EXTRAS_NEARABLE); | ||
displayCurrentNearableInfo(); | ||
|
Oops, something went wrong.
b8545b9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woot! You guys rock!