添加腾讯地图定位按钮
This commit is contained in:
parent
d025fb4f13
commit
d9bf0f2297
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Thu Apr 03 06:08:46 GMT 2025
|
#Thu Apr 03 06:41:21 GMT 2025
|
||||||
stageCount=0
|
stageCount=0
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=1.0
|
baseVersion=1.0
|
||||||
publishVersion=1.0.0
|
publishVersion=1.0.0
|
||||||
buildCount=382
|
buildCount=389
|
||||||
baseBetaVersion=1.0.1
|
baseBetaVersion=1.0.1
|
||||||
|
@ -48,6 +48,8 @@ final public class MainActivity extends AbsActivity implements IWinBollActivity,
|
|||||||
|
|
||||||
public static final String ACTION_SOS = "cc.winboll.studio.libappbase.WinBoll.ACTION_SOS";
|
public static final String ACTION_SOS = "cc.winboll.studio.libappbase.WinBoll.ACTION_SOS";
|
||||||
|
|
||||||
|
static MainActivity _MainActivity;
|
||||||
|
|
||||||
// 创建Fragment列表和标题列表
|
// 创建Fragment列表和标题列表
|
||||||
List<Fragment> fragmentList = new ArrayList<>();
|
List<Fragment> fragmentList = new ArrayList<>();
|
||||||
List<String> tabTitleList = new ArrayList<>();
|
List<String> tabTitleList = new ArrayList<>();
|
||||||
@ -74,11 +76,9 @@ final public class MainActivity extends AbsActivity implements IWinBollActivity,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
// 接收并处理 Intent 数据,函数 Intent 处理接收就直接返回
|
|
||||||
//if (prosessIntents(getIntent())) return;
|
|
||||||
// 以下正常创建主窗口
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
_MainActivity = this;
|
||||||
|
|
||||||
// 初始化工具栏
|
// 初始化工具栏
|
||||||
// mToolbar = findViewById(R.id.toolbar);
|
// mToolbar = findViewById(R.id.toolbar);
|
||||||
@ -131,6 +131,9 @@ final public class MainActivity extends AbsActivity implements IWinBollActivity,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void startTXRTLocation(){
|
||||||
|
mTXMSFragment.startRTLocation();
|
||||||
|
}
|
||||||
|
|
||||||
// ViewPager的适配器
|
// ViewPager的适配器
|
||||||
public class MyPagerAdapter extends FragmentStatePagerAdapter {
|
public class MyPagerAdapter extends FragmentStatePagerAdapter {
|
||||||
|
@ -41,6 +41,7 @@ import android.content.ServiceConnection;
|
|||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import cc.winboll.studio.positions.listeners.OnGPSRTLocationListener;
|
import cc.winboll.studio.positions.listeners.OnGPSRTLocationListener;
|
||||||
|
import cc.winboll.studio.positions.MainActivity;
|
||||||
|
|
||||||
public class PositionsFragment extends Fragment {
|
public class PositionsFragment extends Fragment {
|
||||||
|
|
||||||
@ -57,6 +58,8 @@ public class PositionsFragment extends Fragment {
|
|||||||
TextView mtvPhoneGPSInfo;
|
TextView mtvPhoneGPSInfo;
|
||||||
MyServiceConnection mMyServiceConnection;
|
MyServiceConnection mMyServiceConnection;
|
||||||
GPSService mGPSService;
|
GPSService mGPSService;
|
||||||
|
Button mbtnTXRT;
|
||||||
|
Button mbtnAdd;
|
||||||
|
|
||||||
TextView mtvPostionFixModelInfo;
|
TextView mtvPostionFixModelInfo;
|
||||||
TextView mtvLockPostionInfo;
|
TextView mtvLockPostionInfo;
|
||||||
@ -114,6 +117,22 @@ public class PositionsFragment extends Fragment {
|
|||||||
getActivity().startService(intent);
|
getActivity().startService(intent);
|
||||||
getActivity().bindService(intent, mMyServiceConnection, Context.BIND_IMPORTANT);
|
getActivity().bindService(intent, mMyServiceConnection, Context.BIND_IMPORTANT);
|
||||||
|
|
||||||
|
mbtnTXRT = viewMain.findViewById(R.id.txrt_btn);
|
||||||
|
mbtnTXRT.setOnClickListener(new Button.OnClickListener(){
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
//ToastUtils.show("mbtnTXRT");
|
||||||
|
((MainActivity)getActivity()).startTXRTLocation();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mbtnAdd = viewMain.findViewById(R.id.add_btn);
|
||||||
|
mbtnAdd.setOnClickListener(new Button.OnClickListener(){
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
ToastUtils.show("mbtnAdd");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// metLockLatitude = viewMain.findViewById(R.id.locklatitude_et);
|
// metLockLatitude = viewMain.findViewById(R.id.locklatitude_et);
|
||||||
// metLockLongitude = viewMain.findViewById(R.id.locklongitude_et);
|
// metLockLongitude = viewMain.findViewById(R.id.locklongitude_et);
|
||||||
// metLockLatitude.setEnabled(false);
|
// metLockLatitude.setEnabled(false);
|
||||||
|
@ -122,7 +122,7 @@ public class TXMSFragment extends Fragment implements /*EasyPermissions.Permissi
|
|||||||
MyLocationStyle myLocationStyle = new MyLocationStyle();
|
MyLocationStyle myLocationStyle = new MyLocationStyle();
|
||||||
tencentMap.setMyLocationEnabled(true);
|
tencentMap.setMyLocationEnabled(true);
|
||||||
tencentMap.setMyLocationStyle(myLocationStyle);
|
tencentMap.setMyLocationStyle(myLocationStyle);
|
||||||
startLocation();
|
startRTLocation();
|
||||||
|
|
||||||
return viewRoot;
|
return viewRoot;
|
||||||
}
|
}
|
||||||
@ -147,7 +147,8 @@ public class TXMSFragment extends Fragment implements /*EasyPermissions.Permissi
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startLocation() {
|
public void startRTLocation() {
|
||||||
|
ToastUtils.show("startRTLocation()");
|
||||||
mTencentLocationManager.requestLocationUpdates(mTencentLocationRequest, this);
|
mTencentLocationManager.requestLocationUpdates(mTencentLocationRequest, this);
|
||||||
MyLocationStyle myLocationStyle = new MyLocationStyle();
|
MyLocationStyle myLocationStyle = new MyLocationStyle();
|
||||||
tencentMap.setMyLocationEnabled(true);
|
tencentMap.setMyLocationEnabled(true);
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="150dp">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
@ -20,7 +20,8 @@
|
|||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="10dp">
|
android:padding="10dp"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -44,6 +45,26 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="right">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="۞"
|
||||||
|
android:id="@+id/txrt_btn"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="+"
|
||||||
|
android:id="@+id/add_btn"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user