| |
---|
| | |
---|
| | import androidx.annotation.NonNull; |
---|
| | import androidx.annotation.RequiresApi; |
---|
| | import androidx.appcompat.app.AppCompatActivity; |
---|
| | import androidx.fragment.app.FragmentManager; |
---|
| | import androidx.fragment.app.FragmentTransaction; |
---|
| | |
---|
| | import com.google.android.material.bottomnavigation.BottomNavigationView; |
---|
| | |
---|
| | import org.ntlab.acanthus_client.Acanthus; |
---|
| | import org.ntlab.acanthus_client.R; |
---|
| | import org.ntlab.acanthus_client.entities.Pen; |
---|
| | import org.ntlab.acanthus_client.views.MainActivity; |
---|
| | import org.ntlab.acanthus_client.views.paint.page.PageActivity; |
---|
| | |
---|
| | //----------------------------------------------------------------- |
---|
| | // 描画シーンの下部のツールバー |
---|
| | public class PaintToolBar { |
---|
| | private BottomNavigationView bottomNavigationView; |
---|
| | private BottomNavigationView.OnNavigationItemSelectedListener onNavigationItemSelectedListener; |
---|
| | private FragmentManager fragmentManager; |
---|
| | private PenDetailsFragment penDetailsFragment = new PenDetailsFragment(); |
---|
| | |
---|
| | //----------------------------------------------------------------- |
---|
| | //----------------------------------------------------------------- |
---|
| | public PaintToolBar(PaintActivity paintActivity, PaintCanvas paintCanvas) { |
---|
| |
---|
| | switch (item.getItemId()) { |
---|
| | //----------------------------------------------------------------- |
---|
| | // |
---|
| | case R.id.navigation_pen: |
---|
| | |
---|
| | transitionPenDetailFragment(appCompatActivity); |
---|
| | return true; |
---|
| | //----------------------------------------------------------------- |
---|
| | // |
---|
| | case R.id.navigation_clear: |
---|
| | paintCanvas.clearCanvas(); |
---|
| |
---|
| | } |
---|
| | //----------------------------------------------------------------- |
---|
| | //ペンの詳細変更ページへ移動 |
---|
| | private void transitionPenDetailFragment(AppCompatActivity appCompatActivity){ |
---|
| | Acanthus acanthus =(Acanthus) appCompatActivity.getApplication(); |
---|
| | Intent intent = new Intent(acanthus,PenDetailsFragment.class); |
---|
| | appCompatActivity.startActivity(intent); |
---|
| | fragmentManager = appCompatActivity.getSupportFragmentManager(); |
---|
| | FragmentTransaction transaction = fragmentManager.beginTransaction(); |
---|
| | transaction.replace(R.id.dummyFragment, penDetailsFragment); |
---|
| | transaction.commit(); |
---|
| | |
---|
| | // Acanthus acanthus =(Acanthus) appCompatActivity.getApplication(); |
---|
| | // Intent intent = new Intent(acanthus,PenDetailsFragment.class); |
---|
| | // appCompatActivity.startActivity(intent); |
---|
| | } |
---|
| | |
---|
| | //----------------------------------------------------------------- |
---|
| | // 招待ページへ移動 |
---|
| |
---|
| | |