Skip to content

Commit

Permalink
add matelight webview to "core" tab (fixes #10)
Browse files Browse the repository at this point in the history
replaced google map with OSM
  • Loading branch information
cmile committed Feb 15, 2018
1 parent b41ea68 commit 9eae48f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/main/java/org/c_base/c_beam/activity/ClampActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ public Fragment getItem(int position) {
fragment = new ArtefactListFragment();
} else if (position == GOOGLE_MAP_FRAGMENT) {
fragment = new C_portalWebViewFragment();
((C_portalWebViewFragment) fragment).setUrl(getString(R.string.google_map_url));
//((C_portalWebViewFragment) fragment).setUrl(getString(R.string.google_map_url));
((C_portalWebViewFragment) fragment).setUrl(getString(R.string.osm_map_url));
} else if (position == WWW_CBO_FRAGMENT) {
fragment = new C_portalWebViewFragment();
((C_portalWebViewFragment) fragment).setUrl(getString(R.string.www_cbo_url));
Expand Down
18 changes: 12 additions & 6 deletions src/main/java/org/c_base/c_beam/activity/CoreActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public class CoreActivity extends RingActivity {
private static final int MEMBERINTERFACE_FRAGMENT = 1;
private static final int HYPERBLAST_FRAGMENT = 2;
private static final int MEGABLAST_FRAGMENT = 3;
private static final int RINGINFO_FRAGMENT = 4;
private static final int MATELIGHT_FRAGMENT = 4;
private static final int RINGINFO_FRAGMENT = 5;

SectionsPagerAdapter mSectionsPagerAdapter;
ViewPager mViewPager;
Expand Down Expand Up @@ -120,6 +121,9 @@ public Fragment getItem(int position) {
} else if (position == MEGABLAST_FRAGMENT) {
fragment = new C_portalWebViewFragment();
((C_portalWebViewFragment) fragment).setUrl(getString(R.string.megablast_url));
} else if (position == MATELIGHT_FRAGMENT) {
fragment = new C_portalWebViewFragment();
((C_portalWebViewFragment) fragment).setUrl(getString(R.string.matelight_url));
} else if (position == RINGINFO_FRAGMENT) {
fragment = new RinginfoFragment();
((RinginfoFragment) fragment).setRing("core");
Expand All @@ -135,20 +139,22 @@ public Fragment getItem(int position) {

@Override
public int getCount() {
return 5;
return 6;
}

@Override
public CharSequence getPageTitle(int position) {
switch (position) {
case 0:
case CONTROL_FRAGMENT:
return getString(R.string.title_core_section1).toUpperCase();
case 1:
case MEMBERINTERFACE_FRAGMENT:
return getString(R.string.title_core_section2).toUpperCase();
case 2:
case HYPERBLAST_FRAGMENT:
return getString(R.string.title_core_section3).toUpperCase();
case 3:
case MEGABLAST_FRAGMENT:
return getString(R.string.title_core_section4).toUpperCase();
case MATELIGHT_FRAGMENT:
return "matelight".toUpperCase();
case RINGINFO_FRAGMENT:
return getString(R.string.title_ringinfo).toUpperCase();

Expand Down
2 changes: 2 additions & 0 deletions src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -307,4 +307,6 @@
<string name="pref_mqtt_password_summ">passwort fu:r den MQTT server</string>
<string name="pref_mqtt_id_summ">MQTT client id</string>
<string name="pref_mqtt_id">MQTT ID</string>
<string name="osm_map_url">https://www.openstreetmap.org/#map=18/52.51297/13.42013</string>
<string name="matelight_url">http://matelight.cbrp3.c-base.org/</string>
</resources>

0 comments on commit 9eae48f

Please sign in to comment.