dodano wysuwanie się dolnego paska narzędzi

This commit is contained in:
Naiki00 2021-02-18 15:26:55 +01:00
parent 7596d05205
commit 8bef69b687
3 changed files with 28 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
@ -15,6 +16,7 @@ import androidx.appcompat.app.AppCompatActivity;
import com.example.notatkon.R;
import com.example.notatkon.entities.NoteEntity;
import com.example.notatkon.database.NoteRoomDatabase;
import com.google.android.material.bottomsheet.BottomSheetBehavior;
import java.text.SimpleDateFormat;
import java.util.Date;
@ -70,6 +72,11 @@ public class CreateNote extends AppCompatActivity {
selectedNote = (NoteEntity) getIntent().getSerializableExtra("noteEntity");
fillSelectedNote();
}
setBottomToolbar();
}
//przypisanie obecnej zawartosci notatki nowemu widokowi po kliknieciu
@ -124,4 +131,21 @@ public class CreateNote extends AppCompatActivity {
new SaveNoteTask().execute();
}
private void setBottomToolbar() {
final LinearLayout bottomToolbar = findViewById(R.id.bottomToolbar);
final BottomSheetBehavior<LinearLayout> bottomSheetBehavior = BottomSheetBehavior.from(bottomToolbar);
//wysuwanie dolnego paska narzędzi
bottomToolbar.findViewById(R.id.textBottomToolbar).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (bottomSheetBehavior.getState() != BottomSheetBehavior.STATE_EXPANDED) {
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
} else {
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
}
}
});
}
}

View File

@ -7,12 +7,13 @@
android:layout_height="wrap_content"
android:id="@+id/bottomToolbar"
android:background="@drawable/background_bottom_toolbar"
app:behavior_peekHeight="@dimen/_35sdp"
app:layout_behavior="@string/bottom_sheet_behavior">
<TextView
android:id="@+id/textBottomToolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/_40sdp"
android:layout_height="@dimen/_35sdp"
android:text="Opcje"
android:textColor="@color/black"
android:textSize="@dimen/_12ssp"

View File

@ -121,4 +121,6 @@
</ScrollView>
<include layout="@layout/bottom_toolbar" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>