mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 18:03:33 +00:00
feat: added bottomSheet for shared items on the home screen
This commit is contained in:
parent
ebd1582d1c
commit
077d22167c
2 changed files with 147 additions and 0 deletions
|
|
@ -0,0 +1,37 @@
|
|||
package com.cappielloantonio.tempo.viewmodel;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.AndroidViewModel;
|
||||
|
||||
import com.cappielloantonio.tempo.repository.SharingRepository;
|
||||
import com.cappielloantonio.tempo.subsonic.models.Share;
|
||||
|
||||
public class ShareBottomSheetViewModel extends AndroidViewModel {
|
||||
private final SharingRepository sharingRepository;
|
||||
|
||||
private Share share;
|
||||
|
||||
public ShareBottomSheetViewModel(@NonNull Application application) {
|
||||
super(application);
|
||||
|
||||
sharingRepository = new SharingRepository();
|
||||
}
|
||||
|
||||
public Share getShare() {
|
||||
return share;
|
||||
}
|
||||
|
||||
public void setShare(Share share) {
|
||||
this.share = share;
|
||||
}
|
||||
|
||||
public void updateShare(String description, long expires) {
|
||||
sharingRepository.updateShare(share.getId(), description, expires);
|
||||
}
|
||||
|
||||
public void deleteShare() {
|
||||
sharingRepository.deleteShare(share.getId());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue