parent
baea25e6dc
commit
2d59432be7
@ -1,15 +0,0 @@ |
||||
package com.community.pocket.ui.main.ui.dashboard; |
||||
|
||||
import com.community.pocket.R; |
||||
import com.community.pocket.ui.main.TestMainFragment; |
||||
|
||||
import org.xutils.view.annotation.ContentView; |
||||
|
||||
|
||||
@ContentView(R.layout.fragment_dashboard) |
||||
public class DashboardFragment extends TestMainFragment { |
||||
@Override |
||||
protected int viewId() { |
||||
return R.id.text_dashboard; |
||||
} |
||||
} |
@ -0,0 +1,18 @@ |
||||
package com.community.pocket.ui.main.ui.visitor; |
||||
|
||||
import com.community.pocket.R; |
||||
import com.community.pocket.ui.main.TestMainFragment; |
||||
|
||||
import org.xutils.view.annotation.ContentView; |
||||
|
||||
/** |
||||
* 访客预约界面 |
||||
*/ |
||||
@ContentView(R.layout.visitor_appointment_fragment) |
||||
public class VisitorAppointmentFragment extends TestMainFragment { |
||||
|
||||
@Override |
||||
protected int viewId() { |
||||
return R.id.text_apppointment; |
||||
} |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.community.pocket.ui.main.ui.visitor; |
||||
|
||||
import androidx.lifecycle.ViewModel; |
||||
|
||||
public class VisitorAppointmentViewModel extends ViewModel { |
||||
// TODO: Implement the ViewModel
|
||||
} |
@ -0,0 +1,53 @@ |
||||
package com.community.pocket.ui.main.ui.visitor; |
||||
|
||||
import android.os.Build; |
||||
import android.view.View; |
||||
|
||||
import androidx.annotation.RequiresApi; |
||||
|
||||
import com.community.pocket.R; |
||||
import com.community.pocket.ui.main.MainFragment; |
||||
|
||||
import org.xutils.view.annotation.ContentView; |
||||
import org.xutils.view.annotation.Event; |
||||
|
||||
/** |
||||
* 访客框架 |
||||
*/ |
||||
@ContentView(R.layout.visitor) |
||||
public class VisitorFragment extends MainFragment { |
||||
|
||||
//跳转到访客预约界面
|
||||
@RequiresApi(api = Build.VERSION_CODES.KITKAT) |
||||
@Event(value = R.id.visitor_appointment) |
||||
private void appointment(View view) { |
||||
ctrl().navigate(R.id.visitorAppointmentFragment); |
||||
changeColor(view); |
||||
} |
||||
|
||||
//跳转到我的预约界面
|
||||
@Event(value = R.id.visitor_reservation) |
||||
@RequiresApi(api = Build.VERSION_CODES.KITKAT) |
||||
private void reservation(View view) { |
||||
ctrl().navigate(R.id.visitorReservationFragment); |
||||
changeColor(view); |
||||
} |
||||
|
||||
//跳转到我的访客界面
|
||||
@RequiresApi(api = Build.VERSION_CODES.KITKAT) |
||||
@Event(value = R.id.visitor_visitor) |
||||
private void my(View view) { |
||||
ctrl().navigate(R.id.visitorMyFragment); |
||||
changeColor(view); |
||||
} |
||||
|
||||
@Override |
||||
protected int fragmentId() { |
||||
return R.id.fragment; |
||||
} |
||||
|
||||
@Override |
||||
protected int[] button_ids() { |
||||
return new int[]{R.id.visitor_appointment, R.id.visitor_reservation, R.id.visitor_visitor}; |
||||
} |
||||
} |
@ -0,0 +1,18 @@ |
||||
package com.community.pocket.ui.main.ui.visitor; |
||||
|
||||
import com.community.pocket.R; |
||||
import com.community.pocket.ui.main.TestMainFragment; |
||||
|
||||
import org.xutils.view.annotation.ContentView; |
||||
|
||||
/** |
||||
* 我的访客界面 |
||||
*/ |
||||
@ContentView(R.layout.visitor_my_fragment) |
||||
public class VisitorMyFragment extends TestMainFragment { |
||||
|
||||
@Override |
||||
protected int viewId() { |
||||
return R.id.text_visitor; |
||||
} |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.community.pocket.ui.main.ui.visitor; |
||||
|
||||
import androidx.lifecycle.ViewModel; |
||||
|
||||
public class VisitorMyViewModel extends ViewModel { |
||||
// TODO: Implement the ViewModel
|
||||
} |
@ -0,0 +1,18 @@ |
||||
package com.community.pocket.ui.main.ui.visitor; |
||||
|
||||
import com.community.pocket.R; |
||||
import com.community.pocket.ui.main.TestMainFragment; |
||||
|
||||
import org.xutils.view.annotation.ContentView; |
||||
|
||||
/** |
||||
* 我的预约界面 |
||||
*/ |
||||
@ContentView(R.layout.visitor_reservation_fragment) |
||||
public class VisitorReservationFragment extends TestMainFragment { |
||||
|
||||
@Override |
||||
protected int viewId() { |
||||
return R.id.text_reservation; |
||||
} |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.community.pocket.ui.main.ui.visitor; |
||||
|
||||
import androidx.lifecycle.ViewModel; |
||||
|
||||
public class VisitorReservationViewModel extends ViewModel { |
||||
// TODO: Implement the ViewModel
|
||||
} |
@ -1,14 +1,14 @@ |
||||
package com.community.pocket.ui.main.ui.dashboard; |
||||
package com.community.pocket.ui.main.ui.visitor; |
||||
|
||||
import androidx.lifecycle.LiveData; |
||||
import androidx.lifecycle.MutableLiveData; |
||||
import androidx.lifecycle.ViewModel; |
||||
|
||||
public class DashboardViewModel extends ViewModel { |
||||
public class VisitorViewModel extends ViewModel { |
||||
|
||||
private MutableLiveData<String> mText; |
||||
|
||||
public DashboardViewModel() { |
||||
public VisitorViewModel() { |
||||
mText = new MutableLiveData<>(); |
||||
mText.setValue("This is dashboard fragment"); |
||||
} |
@ -1,22 +0,0 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
xmlns:tools="http://schemas.android.com/tools" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
tools:context=".ui.main.ui.dashboard.DashboardFragment"> |
||||
|
||||
<TextView |
||||
android:id="@+id/text_dashboard" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginStart="8dp" |
||||
android:layout_marginTop="8dp" |
||||
android:layout_marginEnd="8dp" |
||||
android:textAlignment="center" |
||||
android:textSize="20sp" |
||||
app:layout_constraintBottom_toBottomOf="parent" |
||||
app:layout_constraintEnd_toEndOf="parent" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toTopOf="parent" /> |
||||
</androidx.constraintlayout.widget.ConstraintLayout> |
@ -0,0 +1,28 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
xmlns:tools="http://schemas.android.com/tools" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
tools:context=".ui.main.ui.forum.ForumFragment"> |
||||
|
||||
<include |
||||
android:id="@+id/titlebar" |
||||
layout="@layout/visitor_titlebar" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toTopOf="parent" |
||||
tools:layout_constraintEnd_toEndOf="parent" /> |
||||
|
||||
<androidx.fragment.app.FragmentContainerView |
||||
android:id="@+id/fragment" |
||||
android:name="androidx.navigation.fragment.NavHostFragment" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="0dp" |
||||
android:background="@color/colorAccent" |
||||
app:defaultNavHost="true" |
||||
app:layout_constraintBottom_toBottomOf="parent" |
||||
app:layout_constraintEnd_toEndOf="parent" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toBottomOf="@id/titlebar" |
||||
app:navGraph="@navigation/visitor_navigation" /> |
||||
</androidx.constraintlayout.widget.ConstraintLayout> |
@ -0,0 +1,13 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:tools="http://schemas.android.com/tools" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
tools:context=".ui.main.ui.visitor.VisitorAppointmentFragment"> |
||||
|
||||
<TextView |
||||
android:id="@+id/text_apppointment" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" /> |
||||
|
||||
</FrameLayout> |
@ -0,0 +1,13 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:tools="http://schemas.android.com/tools" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
tools:context=".ui.main.ui.visitor.VisitorMyFragment"> |
||||
|
||||
<TextView |
||||
android:id="@+id/text_visitor" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" /> |
||||
|
||||
</FrameLayout> |
@ -0,0 +1,13 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:tools="http://schemas.android.com/tools" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
tools:context=".ui.main.ui.visitor.VisitorReservationFragment"> |
||||
|
||||
<TextView |
||||
android:id="@+id/text_reservation" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" /> |
||||
|
||||
</FrameLayout> |
@ -0,0 +1,43 @@ |
||||
<?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:id="@+id/visitor_titlebar" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content"> |
||||
|
||||
<Button |
||||
android:id="@+id/visitor_appointment" |
||||
style="?android:attr/buttonBarStyle" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:background="@color/colorAccent" |
||||
android:text="@string/forum_hot" |
||||
app:layout_constraintBottom_toBottomOf="parent" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toTopOf="parent" /> |
||||
|
||||
<Button |
||||
android:id="@+id/visitor_reservation" |
||||
style="?android:attr/buttonBarStyle" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:background="@color/button_unchecked" |
||||
android:text="@string/forum_new" |
||||
app:layout_constraintBottom_toBottomOf="parent" |
||||
app:layout_constraintStart_toEndOf="@id/forum_hot" |
||||
app:layout_constraintTop_toTopOf="parent" /> |
||||
|
||||
<Button |
||||
android:id="@+id/visitor_visitor" |
||||
style="?android:attr/buttonBarStyle" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:background="@color/button_unchecked" |
||||
android:text="@string/forum_post" |
||||
app:layout_constraintBottom_toBottomOf="parent" |
||||
app:layout_constraintStart_toEndOf="@id/forum_new" |
||||
app:layout_constraintTop_toTopOf="parent" /> |
||||
</LinearLayout> |
@ -0,0 +1,24 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<navigation xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
xmlns:tools="http://schemas.android.com/tools" |
||||
android:id="@+id/visitor_navigation" |
||||
app:startDestination="@id/visitorAppointmentFragment" |
||||
tools:ignore="UnusedNavigation"> |
||||
|
||||
<fragment |
||||
android:id="@+id/visitorAppointmentFragment" |
||||
android:name="com.community.pocket.ui.main.ui.visitor.VisitorAppointmentFragment" |
||||
android:label="visitor_appointment_fragment" |
||||
tools:layout="@layout/visitor_appointment_fragment" /> |
||||
<fragment |
||||
android:id="@+id/visitorReservationFragment" |
||||
android:name="com.community.pocket.ui.main.ui.visitor.VisitorReservationFragment" |
||||
android:label="visitor_reservation_fragment" |
||||
tools:layout="@layout/visitor_reservation_fragment" /> |
||||
<fragment |
||||
android:id="@+id/visitorMyFragment" |
||||
android:name="com.community.pocket.ui.main.ui.visitor.VisitorMyFragment" |
||||
android:label="visitor_my_fragment" |
||||
tools:layout="@layout/visitor_my_fragment" /> |
||||
</navigation> |
Loading…
Reference in new issue