Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
android:theme="@style/AppTheme">
<activity
android:name=".ui.activities.MainActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
Expand All @@ -21,6 +22,9 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyASWBOWEnNGfMTReDFStViLKibAowpLQ-w"/>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,46 @@
import android.view.View;
import android.view.ViewGroup;

import com.google.android.gms.maps.CameraUpdate;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import com.hardteam.rg.soundcheckstudio.R;

/**
* Created by rg on 3/22/16.
*/
public class ContactsFragment extends Fragment {
public class ContactsFragment extends Fragment implements OnMapReadyCallback {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View contactsView = inflater.inflate(R.layout.contacts_fragment, container, false);
getActivity().setTitle("Контакты");
return contactsView;
}

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);

//SupportMapFragment mapFragment = (SupportMapFragment)getActivity().getSupportFragmentManager().findFragmentById(R.id.map);
SupportMapFragment mapFragment = (SupportMapFragment)getChildFragmentManager().findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}

@Override
public void onMapReady(GoogleMap googleMap)
{
LatLng marker = new LatLng(45.022171,38.98648);
googleMap.setTrafficEnabled(true);
// googleMap.animateCamera(CameraUpdateFactory.zoomTo(16));
googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(marker, 16));
googleMap.addMarker(new MarkerOptions().title("Soundcheck - ул. Суворова 60/1").position(marker).snippet("Тел: +7(906)4364115"));


}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.hardteam.rg.soundcheckstudio.utils;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

/**
* Created by rg on 6/15/16.
*/
public class NetworkStatusChecker
{

//Returns true if the network is available
public static boolean isNetworkAvailable(Context context)
{
ConnectivityManager cm = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
return activeNetwork != null && activeNetwork.isConnectedOrConnecting();
}
}
25 changes: 20 additions & 5 deletions app/src/main/res/layout/contacts_fragment.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout

<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/google_map_contact"
style="@style/Container.MainBackground">
<TextView

<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="@dimen/drawer_header_text"
android:text="Contact info + Google Map navigation"/>
class="com.google.android.gms.maps.SupportMapFragment"/>

</FrameLayout>


<!--<LinearLayout-->
<!--xmlns:android="http://schemas.android.com/apk/res/android"-->
<!--style="@style/Container.MainBackground">-->
<!--<TextView-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="match_parent"-->
<!--android:textSize="@dimen/drawer_header_text"-->
<!--android:text="Contact info + Google Map navigation"/>-->

</LinearLayout>
<!--</LinearLayout>-->
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
<string name="header_font_phone">roboto-medium</string>
<string name="header_font_name">roboto-regular</string>

<string name="google_app_id">soundcheck-1342</string>
</resources>