拨号基本框架设计完成
This commit is contained in:
parent
ffac543f6f
commit
e5dfd5b975
@ -59,9 +59,10 @@ dependencies {
|
|||||||
api 'org.jsoup:jsoup:1.13.1'
|
api 'org.jsoup:jsoup:1.13.1'
|
||||||
api 'com.squareup.okhttp3:okhttp:4.4.1'
|
api 'com.squareup.okhttp3:okhttp:4.4.1'
|
||||||
|
|
||||||
api 'androidx.appcompat:appcompat:1.3.1'
|
api 'androidx.appcompat:appcompat:1.1.0'
|
||||||
|
api 'androidx.viewpager:viewpager:1.0.0'
|
||||||
api 'androidx.fragment:fragment:1.1.0'
|
api 'androidx.fragment:fragment:1.1.0'
|
||||||
api 'com.google.android.material:material:1.1.0'
|
api 'com.google.android.material:material:1.4.0'
|
||||||
|
|
||||||
api 'cc.winboll.studio:libapputils:9.3.2'
|
api 'cc.winboll.studio:libapputils:9.3.2'
|
||||||
api 'cc.winboll.studio:libappbase:1.5.5'
|
api 'cc.winboll.studio:libappbase:1.5.5'
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Thu Feb 20 03:27:00 GMT 2025
|
#Thu Feb 20 06:57:14 GMT 2025
|
||||||
stageCount=0
|
stageCount=0
|
||||||
libraryProject=winboll-shared
|
libraryProject=winboll-shared
|
||||||
baseVersion=1.0
|
baseVersion=1.0
|
||||||
publishVersion=1.0.0
|
publishVersion=1.0.0
|
||||||
buildCount=91
|
buildCount=98
|
||||||
baseBetaVersion=1.0.1
|
baseBetaVersion=1.0.1
|
||||||
|
@ -6,6 +6,9 @@
|
|||||||
<!-- BIND_AUTOFILL_SERVICE -->
|
<!-- BIND_AUTOFILL_SERVICE -->
|
||||||
<uses-permission android:name="android.permission.BIND_AUTOFILL_SERVICE"/>
|
<uses-permission android:name="android.permission.BIND_AUTOFILL_SERVICE"/>
|
||||||
|
|
||||||
|
<!-- 拨打电话 -->
|
||||||
|
<uses-permission android:name="android.permission.CALL_PHONE"/>
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".App"
|
android:name=".App"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
@ -42,7 +45,8 @@
|
|||||||
|
|
||||||
</provider>
|
</provider>
|
||||||
|
|
||||||
<service android:name="cc.winboll.studio.contacts.services.MainService"
|
<service
|
||||||
|
android:name="cc.winboll.studio.contacts.services.MainService"
|
||||||
android:exported="true"/>
|
android:exported="true"/>
|
||||||
|
|
||||||
<service android:name="cc.winboll.studio.contacts.services.AssistantService"/>
|
<service android:name="cc.winboll.studio.contacts.services.AssistantService"/>
|
||||||
@ -57,24 +61,35 @@
|
|||||||
|
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<receiver android:name=".widgets.APPStatusWidget"
|
<receiver
|
||||||
|
android:name=".widgets.APPStatusWidget"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
|
||||||
<action android:name="cc.winboll.studio.contacts.widgets.APPStatusWidget.ACTION_STATUS_ACTIVE" />
|
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
|
||||||
<action android:name="cc.winboll.studio.contacts.widgets.APPStatusWidget.ACTION_STATUS_NOACTIVE" />
|
|
||||||
|
<action android:name="cc.winboll.studio.contacts.widgets.APPStatusWidget.ACTION_STATUS_ACTIVE"/>
|
||||||
|
|
||||||
|
<action android:name="cc.winboll.studio.contacts.widgets.APPStatusWidget.ACTION_STATUS_NOACTIVE"/>
|
||||||
|
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.appwidget.provider"
|
android:name="android.appwidget.provider"
|
||||||
android:resource="@xml/appwidget_provider_info" />
|
android:resource="@xml/appwidget_provider_info"/>
|
||||||
|
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<receiver android:name=".widgets.APPStatusWidgetClickListener">
|
<receiver android:name=".widgets.APPStatusWidgetClickListener">
|
||||||
<intent-filter>
|
|
||||||
<action android:name="cc.winboll.studio.contacts.widgets.APPStatusWidgetClickListener.ACTION_APPICON_CLICK" />
|
|
||||||
</intent-filter>
|
|
||||||
</receiver>
|
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
|
||||||
|
<action android:name="cc.winboll.studio.contacts.widgets.APPStatusWidgetClickListener.ACTION_APPICON_CLICK"/>
|
||||||
|
|
||||||
|
</intent-filter>
|
||||||
|
|
||||||
|
</receiver>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
@ -6,26 +6,28 @@ import android.content.Intent;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
|
import com.google.android.material.tabs.TabLayout;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import cc.winboll.studio.contacts.BuildConfig;
|
import androidx.viewpager.widget.ViewPager;
|
||||||
import cc.winboll.studio.contacts.MainActivity;
|
|
||||||
import cc.winboll.studio.contacts.R;
|
import cc.winboll.studio.contacts.R;
|
||||||
|
import cc.winboll.studio.contacts.adapters.MyPagerAdapter;
|
||||||
import cc.winboll.studio.contacts.beans.MainServiceBean;
|
import cc.winboll.studio.contacts.beans.MainServiceBean;
|
||||||
import cc.winboll.studio.contacts.services.MainService;
|
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
import cc.winboll.studio.libappbase.LogView;
|
import cc.winboll.studio.libappbase.LogView;
|
||||||
import cc.winboll.studio.libappbase.SOS;
|
|
||||||
import cc.winboll.studio.libappbase.bean.APPSOSBean;
|
|
||||||
import cc.winboll.studio.libapputils.app.IWinBollActivity;
|
import cc.winboll.studio.libapputils.app.IWinBollActivity;
|
||||||
import cc.winboll.studio.libapputils.app.WinBollActivityManager;
|
import cc.winboll.studio.libapputils.app.WinBollActivityManager;
|
||||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||||
import cc.winboll.studio.libapputils.view.YesNoAlertDialog;
|
import cc.winboll.studio.libapputils.view.YesNoAlertDialog;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.view.View;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
final public class MainActivity extends AppCompatActivity implements IWinBollActivity {
|
final public class MainActivity extends AppCompatActivity implements IWinBollActivity, ViewPager.OnPageChangeListener, View.OnClickListener {
|
||||||
|
|
||||||
public static final String TAG = "MainActivity";
|
public static final String TAG = "MainActivity";
|
||||||
|
|
||||||
@ -38,6 +40,14 @@ final public class MainActivity extends AppCompatActivity implements IWinBollAct
|
|||||||
Toolbar mToolbar;
|
Toolbar mToolbar;
|
||||||
CheckBox cbMainService;
|
CheckBox cbMainService;
|
||||||
MainServiceBean mMainServiceBean;
|
MainServiceBean mMainServiceBean;
|
||||||
|
ViewPager viewPager;
|
||||||
|
private List<View> views; //用来存放放进ViewPager里面的布局
|
||||||
|
//实例化存储imageView(导航原点)的集合
|
||||||
|
ImageView[] imageViews;
|
||||||
|
//MyPagerAdapter adapter;//适配器
|
||||||
|
MyPagerAdapter pagerAdapter;
|
||||||
|
LinearLayout linearLayout;//下标所在在LinearLayout布局里
|
||||||
|
int currentPoint = 0;//当前被选中中页面的下标
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AppCompatActivity getActivity() {
|
public AppCompatActivity getActivity() {
|
||||||
@ -71,10 +81,6 @@ final public class MainActivity extends AppCompatActivity implements IWinBollAct
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
mLogView = findViewById(R.id.activitymainLogView1);
|
|
||||||
|
|
||||||
if (GlobalApplication.isDebuging()) { mLogView.start(); }
|
|
||||||
|
|
||||||
// 初始化工具栏
|
// 初始化工具栏
|
||||||
mToolbar = findViewById(R.id.activitymainToolbar1);
|
mToolbar = findViewById(R.id.activitymainToolbar1);
|
||||||
setSupportActionBar(mToolbar);
|
setSupportActionBar(mToolbar);
|
||||||
@ -84,46 +90,118 @@ final public class MainActivity extends AppCompatActivity implements IWinBollAct
|
|||||||
}
|
}
|
||||||
getSupportActionBar().setSubtitle(getTag());
|
getSupportActionBar().setSubtitle(getTag());
|
||||||
|
|
||||||
//ToastUtils.show("WinBollUI_TYPE " + WinBollApplication.getWinBollUI_TYPE());
|
initData();
|
||||||
LogUtils.d(TAG, "BuildConfig.DEBUG : " + Boolean.toString(BuildConfig.DEBUG));
|
initView();//调用初始化视图方法
|
||||||
|
//initPoint();//调用初始化导航原点的方法
|
||||||
|
viewPager.addOnPageChangeListener(this);//滑动事件
|
||||||
|
|
||||||
mMainServiceBean = MainServiceBean.loadBean(this, MainServiceBean.class);
|
ViewPager viewPager = findViewById(R.id.activitymainViewPager1);
|
||||||
if (mMainServiceBean == null) {
|
MyPagerAdapter pagerAdapter = new MyPagerAdapter(getSupportFragmentManager());
|
||||||
mMainServiceBean = new MainServiceBean();
|
viewPager.setAdapter(pagerAdapter);
|
||||||
}
|
TabLayout tabLayout = findViewById(R.id.activitymainTabLayout1);
|
||||||
cbMainService = findViewById(R.id.activitymainCheckBox1);
|
tabLayout.setupWithViewPager(viewPager);
|
||||||
cbMainService.setChecked(mMainServiceBean.isEnable());
|
|
||||||
cbMainService.setOnClickListener(new View.OnClickListener(){
|
// mMainServiceBean = MainServiceBean.loadBean(this, MainServiceBean.class);
|
||||||
@Override
|
// if (mMainServiceBean == null) {
|
||||||
public void onClick(View view) {
|
// mMainServiceBean = new MainServiceBean();
|
||||||
if (cbMainService.isChecked()) {
|
// }
|
||||||
MainService.startMainService(MainActivity.this);
|
// cbMainService = findViewById(R.id.activitymainCheckBox1);
|
||||||
} else {
|
// cbMainService.setChecked(mMainServiceBean.isEnable());
|
||||||
MainService.stopMainService(MainActivity.this);
|
// cbMainService.setOnClickListener(new View.OnClickListener(){
|
||||||
}
|
// @Override
|
||||||
}
|
// public void onClick(View view) {
|
||||||
});
|
// if (cbMainService.isChecked()) {
|
||||||
|
// MainService.startMainService(MainActivity.this);
|
||||||
|
// } else {
|
||||||
|
// MainService.stopMainService(MainActivity.this);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
// public static void sosToWinBoll(Context context) {
|
|
||||||
// Intent intent = new Intent(ACTION_SOS);
|
//初始化view,即显示的图片
|
||||||
// intent.putExtra("sos", "SOS");
|
void initView() {
|
||||||
// intent.putExtra("sosPackage", context.getPackageName());
|
viewPager = findViewById(R.id.activitymainViewPager1);
|
||||||
// intent.putExtra("sosCalssType", "Service");
|
pagerAdapter = new MyPagerAdapter(getSupportFragmentManager());
|
||||||
// intent.putExtra("sosClassName", MainService.class.getName());
|
viewPager.setAdapter(pagerAdapter);
|
||||||
// String szToPackage = "";
|
//adapter = new MyPagerAdapter(views);
|
||||||
// if (GlobalApplication.isDebuging()) {
|
//viewPager = findViewById(R.id.activitymainViewPager1);
|
||||||
// szToPackage = "cc.winboll.studio.appbase.beta";
|
//viewPager.setAdapter(adapter);
|
||||||
// } else {
|
//linearLayout = findViewById(R.id.activitymainLinearLayout1);
|
||||||
// szToPackage = "cc.winboll.studio.appbase";
|
//initPoint();//初始化页面下方的点
|
||||||
|
viewPager.setOnPageChangeListener(this);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//初始化所要显示的布局
|
||||||
|
void initData() {
|
||||||
|
ViewPager viewPager = findViewById(R.id.activitymainViewPager1);
|
||||||
|
LayoutInflater inflater = LayoutInflater.from(getActivity());
|
||||||
|
View view1 = inflater.inflate(R.layout.fragment_call, viewPager, false);
|
||||||
|
View view2 = inflater.inflate(R.layout.fragment_contacts, viewPager, false);
|
||||||
|
View view3 = inflater.inflate(R.layout.fragment_log, viewPager, false);
|
||||||
|
|
||||||
|
views = new ArrayList<>();
|
||||||
|
views.add(view1);
|
||||||
|
views.add(view2);
|
||||||
|
views.add(view3);
|
||||||
|
}
|
||||||
|
|
||||||
|
// void initPoint() {
|
||||||
|
// imageViews = new ImageView[5];//实例化5个图片
|
||||||
|
// for (int i = 0; i < linearLayout.getChildCount(); i++) {
|
||||||
|
// imageViews[i] = (ImageView) linearLayout.getChildAt(i);
|
||||||
|
// imageViews[i].setImageResource(R.drawable.ic_launcher);
|
||||||
|
// imageViews[i].setOnClickListener(this);//点击导航点,即可跳转
|
||||||
|
// imageViews[i].setTag(i);//重复利用实例化的对象
|
||||||
// }
|
// }
|
||||||
// intent.setPackage(szToPackage);
|
// currentPoint = 0;//默认第一个坐标
|
||||||
// context.sendBroadcast(intent);
|
// imageViews[currentPoint].setImageResource(R.drawable.ic_launcher);
|
||||||
//
|
|
||||||
// LogUtils.d(TAG, String.format("SOS Send To WinBoll. (szToPackage : %s)", szToPackage));
|
|
||||||
// //ToastUtils.show("SOS Send To WinBoll");
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
//OnPageChangeListener接口要实现的三个方法
|
||||||
|
/* onPageScrollStateChanged(int state)
|
||||||
|
此方法是在状态改变的时候调用,其中state这个参数有三种状态:
|
||||||
|
SCROLL_STATE_DRAGGING(1)表示用户手指“按在屏幕上并且开始拖动”的状态
|
||||||
|
(手指按下但是还没有拖动的时候还不是这个状态,只有按下并且手指开始拖动后log才打出。)
|
||||||
|
SCROLL_STATE_IDLE(0)滑动动画做完的状态。
|
||||||
|
SCROLL_STATE_SETTLING(2)在“手指离开屏幕”的状态。*/
|
||||||
|
@Override
|
||||||
|
public void onPageScrollStateChanged(int state) {
|
||||||
|
|
||||||
|
}
|
||||||
|
/* onPageScrolled(int position, float positionOffset, int positionOffsetPixels)
|
||||||
|
当页面在滑动的时候会调用此方法,在滑动被停止之前,此方法回一直得到调用。其中三个参数的含义分别为:
|
||||||
|
|
||||||
|
position :当前页面,即你点击滑动的页面(从A滑B,则是A页面的position。
|
||||||
|
positionOffset:当前页面偏移的百分比
|
||||||
|
positionOffsetPixels:当前页面偏移的像素位置*/
|
||||||
|
@Override
|
||||||
|
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||||
|
|
||||||
|
}
|
||||||
|
/* onPageSelected(int position)
|
||||||
|
此方法是页面滑动完后得到调用,position是你当前选中的页面的Position(位置编号)
|
||||||
|
(从A滑动到B,就是B的position)*/
|
||||||
|
public void onPageSelected(int position) {
|
||||||
|
|
||||||
|
// ImageView preView = imageViews[currentPoint];
|
||||||
|
// preView.setImageResource(R.drawable.ic_launcher);
|
||||||
|
// ImageView currView = imageViews[position];
|
||||||
|
// currView.setImageResource(R.drawable.ic_launcher);
|
||||||
|
// currentPoint = position;
|
||||||
|
}
|
||||||
|
|
||||||
|
//小圆点点击事件
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
//通过getTag(),可以判断是哪个控件
|
||||||
|
// int i = (Integer) v.getTag();
|
||||||
|
// viewPager.setCurrentItem(i);//直接跳转到某一个页面的情况
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostCreate(Bundle savedInstanceState) {
|
protected void onPostCreate(Bundle savedInstanceState) {
|
||||||
super.onPostCreate(savedInstanceState);
|
super.onPostCreate(savedInstanceState);
|
||||||
|
@ -0,0 +1,14 @@
|
|||||||
|
package cc.winboll.studio.contacts.adapters;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
|
* @Date 2025/02/20 14:20:38
|
||||||
|
* @Describe ImagePagerAdapter
|
||||||
|
*/
|
||||||
|
public class ImagePagerAdapter {
|
||||||
|
|
||||||
|
public static final String TAG = "ImagePagerAdapter";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
package cc.winboll.studio.contacts.adapters;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
|
* @Date 2025/02/20 13:33:04
|
||||||
|
* @Describe MyPagerAdapter
|
||||||
|
*/
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentManager;
|
||||||
|
import androidx.fragment.app.FragmentPagerAdapter;
|
||||||
|
import cc.winboll.studio.contacts.fragments.CallFragment;
|
||||||
|
import cc.winboll.studio.contacts.fragments.ContactsFragment;
|
||||||
|
import cc.winboll.studio.contacts.fragments.LogFragment;
|
||||||
|
|
||||||
|
public class MyPagerAdapter extends FragmentPagerAdapter {
|
||||||
|
public static final String TAG = "MyPagerAdapter";
|
||||||
|
|
||||||
|
private static final int PAGE_COUNT = 3;
|
||||||
|
|
||||||
|
public MyPagerAdapter(@NonNull FragmentManager fm) {
|
||||||
|
super(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public Fragment getItem(int position) {
|
||||||
|
if(position == 1) {
|
||||||
|
return ContactsFragment.newInstance(position);
|
||||||
|
} else if(position == 2) {
|
||||||
|
return LogFragment.newInstance(position);
|
||||||
|
} else {
|
||||||
|
return CallFragment.newInstance(position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCount() {
|
||||||
|
return PAGE_COUNT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,51 @@
|
|||||||
|
package cc.winboll.studio.contacts.fragments;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
|
* @Date 2025/02/20 12:57:00
|
||||||
|
* @Describe 拨号
|
||||||
|
*/
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import cc.winboll.studio.contacts.R;
|
||||||
|
import cc.winboll.studio.libappbase.LogView;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
public class CallFragment extends Fragment {
|
||||||
|
|
||||||
|
public static final String TAG = "CallFragment";
|
||||||
|
|
||||||
|
private static final String ARG_PAGE = "ARG_PAGE";
|
||||||
|
private int mPage;
|
||||||
|
|
||||||
|
public static CallFragment newInstance(int page) {
|
||||||
|
Bundle args = new Bundle();
|
||||||
|
args.putInt(ARG_PAGE, page);
|
||||||
|
CallFragment fragment = new CallFragment();
|
||||||
|
fragment.setArguments(args);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
if (getArguments()!= null) {
|
||||||
|
mPage = getArguments().getInt(ARG_PAGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||||
|
@Nullable Bundle savedInstanceState) {
|
||||||
|
View view = inflater.inflate(R.layout.fragment_call, container, false);
|
||||||
|
TextView textView = view.findViewById(R.id.page_text);
|
||||||
|
textView.setText("这是第 " + mPage + " 页");
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
package cc.winboll.studio.contacts.fragments;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
|
* @Date 2025/02/20 12:57:50
|
||||||
|
* @Describe 联系人
|
||||||
|
*/
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import cc.winboll.studio.contacts.R;
|
||||||
|
|
||||||
|
public class ContactsFragment extends Fragment {
|
||||||
|
|
||||||
|
public static final String TAG = "ContactsFragment";
|
||||||
|
|
||||||
|
private static final String ARG_PAGE = "ARG_PAGE";
|
||||||
|
private int mPage;
|
||||||
|
|
||||||
|
public static ContactsFragment newInstance(int page) {
|
||||||
|
Bundle args = new Bundle();
|
||||||
|
args.putInt(ARG_PAGE, page);
|
||||||
|
ContactsFragment fragment = new ContactsFragment();
|
||||||
|
fragment.setArguments(args);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
if (getArguments()!= null) {
|
||||||
|
mPage = getArguments().getInt(ARG_PAGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||||
|
@Nullable Bundle savedInstanceState) {
|
||||||
|
View view = inflater.inflate(R.layout.fragment_contacts, container, false);
|
||||||
|
TextView textView = view.findViewById(R.id.page_text);
|
||||||
|
textView.setText("这是第 " + mPage + " 页");
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
package cc.winboll.studio.contacts.fragments;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
|
* @Date 2025/02/20 12:58:15
|
||||||
|
* @Describe 应用日志
|
||||||
|
*/
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import cc.winboll.studio.contacts.R;
|
||||||
|
import cc.winboll.studio.libappbase.LogView;
|
||||||
|
|
||||||
|
public class LogFragment extends Fragment {
|
||||||
|
|
||||||
|
public static final String TAG = "LogFragment";
|
||||||
|
|
||||||
|
private static final String ARG_PAGE = "ARG_PAGE";
|
||||||
|
private int mPage;
|
||||||
|
|
||||||
|
public static LogFragment newInstance(int page) {
|
||||||
|
Bundle args = new Bundle();
|
||||||
|
args.putInt(ARG_PAGE, page);
|
||||||
|
LogFragment fragment = new LogFragment();
|
||||||
|
fragment.setArguments(args);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
if (getArguments() != null) {
|
||||||
|
mPage = getArguments().getInt(ARG_PAGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||||
|
@Nullable Bundle savedInstanceState) {
|
||||||
|
View view = inflater.inflate(R.layout.fragment_log, container, false);
|
||||||
|
LogView logView = view.findViewById(R.id.logview);
|
||||||
|
logView.start();
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
}
|
@ -2,6 +2,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
@ -11,34 +12,16 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/activitymainToolbar1"/>
|
android:id="@+id/activitymainToolbar1"/>
|
||||||
|
|
||||||
<LinearLayout
|
<androidx.viewpager.widget.ViewPager
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:gravity="center"
|
|
||||||
android:layout_weight="1.0"
|
android:layout_weight="1.0"
|
||||||
android:background="#FFEEEEEE">
|
android:id="@+id/activitymainViewPager1"/>
|
||||||
|
|
||||||
<LinearLayout
|
<com.google.android.material.tabs.TabLayout
|
||||||
android:orientation="horizontal"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="60dp"
|
||||||
android:layout_height="wrap_content">
|
android:id="@+id/activitymainTabLayout1"/>
|
||||||
|
|
||||||
<CheckBox
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="MainService"
|
|
||||||
android:id="@+id/activitymainCheckBox1"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<cc.winboll.studio.libappbase.LogView
|
|
||||||
android:layout_weight="1.0"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:id="@+id/activitymainLogView1"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
29
contacts/src/main/res/layout/fragment_call.xml
Normal file
29
contacts/src/main/res/layout/fragment_call.xml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:ems="10"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1.0"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Text"
|
||||||
|
android:id="@+id/page_text"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
15
contacts/src/main/res/layout/fragment_contacts.xml
Normal file
15
contacts/src/main/res/layout/fragment_contacts.xml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Text"
|
||||||
|
android:id="@+id/page_text"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
12
contacts/src/main/res/layout/fragment_log.xml
Normal file
12
contacts/src/main/res/layout/fragment_log.xml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
<cc.winboll.studio.libappbase.LogView
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:id="@+id/logview"/>
|
||||||
|
</LinearLayout>
|
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Thu Feb 20 03:27:00 GMT 2025
|
#Thu Feb 20 06:57:14 GMT 2025
|
||||||
stageCount=0
|
stageCount=0
|
||||||
libraryProject=winboll-shared
|
libraryProject=winboll-shared
|
||||||
baseVersion=1.0
|
baseVersion=1.0
|
||||||
publishVersion=1.0.0
|
publishVersion=1.0.0
|
||||||
buildCount=91
|
buildCount=98
|
||||||
baseBetaVersion=1.0.1
|
baseBetaVersion=1.0.1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user