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