Schedule toots & edition

This commit is contained in:
tom79 2017-07-16 19:04:53 +02:00
parent c327bd8938
commit 4d4bcd49d1
29 changed files with 238 additions and 124 deletions

View File

@ -129,6 +129,7 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
private String sharedContent, sharedSubject;
private CheckBox toot_sensitive;
public long currentToId;
private long restored;
private String pattern = "^.*(@([a-zA-Z0-9_]{2,}))$";
@Override
@ -175,6 +176,10 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
changeDrawableColor(TootActivity.this, R.drawable.ic_action_globe,R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_action_camera,R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_skip_previous,R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_skip_next,R.color.dark_text);
changeDrawableColor(TootActivity.this, R.drawable.ic_check,R.color.dark_text);
}else {
changeDrawableColor(TootActivity.this, R.drawable.ic_action_globe,R.color.black);
changeDrawableColor(TootActivity.this, R.drawable.ic_action_lock_open,R.color.black);
@ -183,6 +188,11 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
changeDrawableColor(TootActivity.this, R.drawable.ic_action_globe,R.color.black);
changeDrawableColor(TootActivity.this, R.drawable.ic_action_camera,R.color.black);
changeDrawableColor(TootActivity.this, R.drawable.ic_skip_previous,R.color.black);
changeDrawableColor(TootActivity.this, R.drawable.ic_skip_next,R.color.black);
changeDrawableColor(TootActivity.this, R.drawable.ic_check,R.color.black);
}
final LinearLayout drawer_layout = (LinearLayout) findViewById(R.id.drawer_layout);
@ -224,10 +234,16 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
});
Bundle b = getIntent().getExtras();
restored = -1;
if(b != null) {
tootReply = b.getParcelable("tootReply");
sharedContent = b.getString("sharedContent", null);
sharedSubject = b.getString("sharedSubject", null);
restored = b.getLong("restored", -1);
}
if( restored != -1 ){
toot_it.setVisibility(View.GONE);
invalidateOptionsMenu();
}
if( tootReply != null) {
setTitle(R.string.toot_title_reply);
@ -470,7 +486,9 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
toot_space_left.setText(String.valueOf((maxChar - totalChar)));
}
});
if( restored != -1 ){
restoreToot(restored);
}
}
@ -580,74 +598,7 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
@Override
public void onClick(DialogInterface dialog, int which) {
int id = ids[which];
StoredStatus draft = new StatusStoredDAO(TootActivity.this, db).getStatus(id);
Status status = draft.getStatus();
//Retrieves attachments
attachments = status.getMedia_attachments();
toot_picture_container.removeAllViews();
loading_picture.setVisibility(View.GONE);
if( attachments != null && attachments.size() > 0){
toot_picture_container.setVisibility(View.VISIBLE);
int i = 0 ;
for(Attachment attachment: attachments){
String url = attachment.getPreview_url();
if( url == null || url.trim().equals(""))
url = attachment.getUrl();
final ImageView imageView = new ImageView(getApplicationContext());
imageView.setId(Integer.parseInt(attachment.getId()));
imageLoader.displayImage(url, imageView, options);
LinearLayout.LayoutParams imParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
imParams.setMargins(20, 5, 20, 5);
imParams.height = (int) Helper.convertDpToPixel(100, getApplicationContext());
imageView.setAdjustViewBounds(true);
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
toot_picture_container.addView(imageView, i, imParams);
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showRemove(imageView.getId());
}
});
if( attachments.size() < 4)
toot_picture.setEnabled(true);
toot_sensitive.setVisibility(View.VISIBLE);
i++;
}
}else {
toot_picture_container.setVisibility(View.GONE);
}
//Sensitive content
toot_sensitive.setChecked(status.isSensitive());
if( status.getSpoiler_text() != null && status.getSpoiler_text().length() > 0 ){
toot_cw_content.setText(status.getSpoiler_text());
toot_cw_content.setVisibility(View.VISIBLE);
}else {
toot_cw_content.setText("");
toot_cw_content.setVisibility(View.GONE);
}
String content = status.getContent();
toot_content.setText(content);
toot_content.setSelection(toot_content.getText().length());
switch (status.getVisibility()){
case "public":
visibility = "public";
toot_visibility.setImageResource(R.drawable.ic_action_globe);
break;
case "unlisted":
visibility = "unlisted";
toot_visibility.setImageResource(R.drawable.ic_action_lock_open);
break;
case "private":
visibility = "private";
toot_visibility.setImageResource(R.drawable.ic_action_lock_closed);
break;
case "direct":
visibility = "direct";
toot_visibility.setImageResource(R.drawable.ic_local_post_office);
break;
}
//The current id is set to the draft
currentToId = draft.getId();
restoreToot(id);
dialog.dismiss();
}
});
@ -671,9 +622,9 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
final DatePicker datePicker = (DatePicker) dialogView.findViewById(R.id.date_picker);
final TimePicker timePicker = (TimePicker) dialogView.findViewById(R.id.time_picker);
Button date_time_cancel = (Button) dialogView.findViewById(R.id.date_time_cancel);
final Button date_time_previous = (Button) dialogView.findViewById(R.id.date_time_previous);
final Button date_time_next = (Button) dialogView.findViewById(R.id.date_time_next);
final Button date_time_set = (Button) dialogView.findViewById(R.id.date_time_set);
final ImageButton date_time_previous = (ImageButton) dialogView.findViewById(R.id.date_time_previous);
final ImageButton date_time_next = (ImageButton) dialogView.findViewById(R.id.date_time_next);
final ImageButton date_time_set = (ImageButton) dialogView.findViewById(R.id.date_time_set);
//Buttons management
date_time_cancel.setOnClickListener(new View.OnClickListener() {
@ -727,7 +678,7 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
//Store the toot as draft first
storeToot(false);
//Schedules the toot
ScheduledTootsSyncJob.schedule(getApplicationContext(), true, currentToId, time);
ScheduledTootsSyncJob.schedule(getApplicationContext(), false, currentToId, time);
//Clear content
toot_content.setText("");
toot_cw_content.setText("");
@ -761,6 +712,14 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_toot, menu);
if( restored != -1 ){
MenuItem itemRestore = menu.findItem(R.id.action_restore);
if( itemRestore != null)
itemRestore.setVisible(false);
MenuItem itemSchedule = menu.findItem(R.id.action_schedule);
if( itemSchedule != null)
itemSchedule.setVisible(false);
}
return true;
}
@ -950,6 +909,79 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
}
}
private void restoreToot(long id){
SQLiteDatabase db = Sqlite.getInstance(getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
StoredStatus draft = new StatusStoredDAO(TootActivity.this, db).getStatus(id);
Status status = draft.getStatus();
//Retrieves attachments
attachments = status.getMedia_attachments();
toot_picture_container.removeAllViews();
loading_picture.setVisibility(View.GONE);
if( attachments != null && attachments.size() > 0){
toot_picture_container.setVisibility(View.VISIBLE);
int i = 0 ;
for(Attachment attachment: attachments){
String url = attachment.getPreview_url();
if( url == null || url.trim().equals(""))
url = attachment.getUrl();
final ImageView imageView = new ImageView(getApplicationContext());
imageView.setId(Integer.parseInt(attachment.getId()));
imageLoader.displayImage(url, imageView, options);
LinearLayout.LayoutParams imParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
imParams.setMargins(20, 5, 20, 5);
imParams.height = (int) Helper.convertDpToPixel(100, getApplicationContext());
imageView.setAdjustViewBounds(true);
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
toot_picture_container.addView(imageView, i, imParams);
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showRemove(imageView.getId());
}
});
if( attachments.size() < 4)
toot_picture.setEnabled(true);
toot_sensitive.setVisibility(View.VISIBLE);
i++;
}
}else {
toot_picture_container.setVisibility(View.GONE);
}
//Sensitive content
toot_sensitive.setChecked(status.isSensitive());
if( status.getSpoiler_text() != null && status.getSpoiler_text().length() > 0 ){
toot_cw_content.setText(status.getSpoiler_text());
toot_cw_content.setVisibility(View.VISIBLE);
}else {
toot_cw_content.setText("");
toot_cw_content.setVisibility(View.GONE);
}
String content = status.getContent();
toot_content.setText(content);
toot_content.setSelection(toot_content.getText().length());
switch (status.getVisibility()){
case "public":
visibility = "public";
toot_visibility.setImageResource(R.drawable.ic_action_globe);
break;
case "unlisted":
visibility = "unlisted";
toot_visibility.setImageResource(R.drawable.ic_action_lock_open);
break;
case "private":
visibility = "private";
toot_visibility.setImageResource(R.drawable.ic_action_lock_closed);
break;
case "direct":
visibility = "direct";
toot_visibility.setImageResource(R.drawable.ic_local_post_office);
break;
}
//The current id is set to the draft
currentToId = draft.getId();
}
private void storeToot(boolean message){
//Nothing to store here....
if(toot_content.getText().toString().trim().length() == 0 && (attachments == null || attachments.size() <1) && toot_cw_content.getText().toString().trim().length() == 0)

View File

@ -14,7 +14,7 @@ public class StoredStatus {
private Date creation_date;
private Date scheduled_date;
private Date sent_date;
private boolean isScheduled;
private int jobId;
private boolean isSent;
private Status status;
private String instance;
@ -52,13 +52,6 @@ public class StoredStatus {
this.sent_date = sent_date;
}
public boolean isScheduled() {
return isScheduled;
}
public void setScheduled(boolean scheduled) {
isScheduled = scheduled;
}
public boolean isSent() {
return isSent;
@ -91,4 +84,12 @@ public class StoredStatus {
public void setAcct(String acct) {
this.acct = acct;
}
public int getJobId() {
return jobId;
}
public void setJobId(int jobId) {
this.jobId = jobId;
}
}

View File

@ -106,7 +106,7 @@ public class DraftsListAdapter extends BaseAdapter {
@Override
public void onClick(View v) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setMessage(draft.getStatus().getContent() + '\n' + draft.getCreation_date());
builder.setMessage(draft.getStatus().getContent() + '\n' + Helper.dateToString(context, draft.getCreation_date()));
builder.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle(R.string.remove_draft)
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {

View File

@ -17,8 +17,12 @@ package fr.gouv.etalab.mastodon.drawers;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.support.v7.widget.CardView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -26,10 +30,19 @@ import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.evernote.android.job.Job;
import com.evernote.android.job.JobManager;
import com.evernote.android.job.JobRequest;
import java.util.List;
import java.util.Set;
import fr.gouv.etalab.mastodon.activities.TootActivity;
import fr.gouv.etalab.mastodon.client.Entities.Status;
import fr.gouv.etalab.mastodon.client.Entities.StoredStatus;
import fr.gouv.etalab.mastodon.helper.Helper;
import fr.gouv.etalab.mastodon.jobs.ScheduledTootsSyncJob;
import fr.gouv.etalab.mastodon.sqlite.Sqlite;
import fr.gouv.etalab.mastodon.sqlite.StatusStoredDAO;
import mastodon.etalab.gouv.fr.mastodon.R;
@ -82,9 +95,11 @@ public class ScheduledTootsListAdapter extends BaseAdapter {
if (convertView == null) {
convertView = layoutInflater.inflate(R.layout.drawer_scheduled_toot, parent, false);
holder = new ViewHolder();
holder.scheduled_toot_container = (CardView) convertView.findViewById(R.id.scheduled_toot_container);
holder.scheduled_toot_title = (TextView) convertView.findViewById(R.id.scheduled_toot_title);
holder.scheduled_toot_date_creation = (TextView) convertView.findViewById(R.id.scheduled_toot_date_creation);
holder.scheduled_toot_media_count = (TextView) convertView.findViewById(R.id.scheduled_toot_media_count);
holder.scheduled_toot_failed = (TextView) convertView.findViewById(R.id.scheduled_toot_failed);
holder.scheduled_toot_delete = (ImageView) convertView.findViewById(R.id.scheduled_toot_delete);
holder.scheduled_toot_privacy = (ImageView) convertView.findViewById(R.id.scheduled_toot_privacy);
holder.scheduled_toot_date = (Button) convertView.findViewById(R.id.scheduled_toot_date);
@ -128,12 +143,14 @@ public class ScheduledTootsListAdapter extends BaseAdapter {
}
final SQLiteDatabase db = Sqlite.getInstance(context, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
final Job job = JobManager.instance().getJob(storedStatus.getJobId());
//Delete scheduled toot
holder.scheduled_toot_delete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setMessage(status.getContent() + '\n' + storedStatus.getCreation_date());
builder.setMessage(status.getContent() + '\n' + Helper.dateToString(context, storedStatus.getCreation_date()));
builder.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle(R.string.remove_scheduled)
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@ -155,18 +172,44 @@ public class ScheduledTootsListAdapter extends BaseAdapter {
.show();
}
});
if( job == null){
holder.scheduled_toot_failed.setVisibility(View.VISIBLE);
}else {
holder.scheduled_toot_failed.setVisibility(View.GONE);
}
holder.scheduled_toot_media_count.setText(context.getString(R.string.media_count, status.getMedia_attachments().size()));
holder.scheduled_toot_date_creation.setText(Helper.dateToString(context, storedStatus.getCreation_date()));
holder.scheduled_toot_date.setText(Helper.dateToString(context, storedStatus.getScheduled_date()));
holder.scheduled_toot_date_creation.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
holder.scheduled_toot_title.setText(status.getContent());
holder.scheduled_toot_container.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intentToot = new Intent(context, TootActivity.class);
Bundle b = new Bundle();
b.putLong("restored", storedStatus.getId());
intentToot.putExtras(b);
context.startActivity(intentToot);
}
});
return convertView;
}
private class ViewHolder {
CardView scheduled_toot_container;
TextView scheduled_toot_title;
TextView scheduled_toot_date_creation;
TextView scheduled_toot_media_count;
TextView scheduled_toot_failed;
ImageView scheduled_toot_delete;
ImageView scheduled_toot_privacy;
Button scheduled_toot_date;

View File

@ -15,6 +15,7 @@ package fr.gouv.etalab.mastodon.fragments;
* see <http://www.gnu.org/licenses>. */
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.Fragment;
@ -28,6 +29,8 @@ import fr.gouv.etalab.mastodon.asynctasks.RetrieveScheduledTootsAsyncTask;
import fr.gouv.etalab.mastodon.client.Entities.StoredStatus;
import fr.gouv.etalab.mastodon.drawers.ScheduledTootsListAdapter;
import fr.gouv.etalab.mastodon.interfaces.OnRetrieveScheduledTootsInterface;
import fr.gouv.etalab.mastodon.sqlite.Sqlite;
import fr.gouv.etalab.mastodon.sqlite.StatusStoredDAO;
import mastodon.etalab.gouv.fr.mastodon.R;
@ -55,11 +58,20 @@ public class DisplayScheduledTootsFragment extends Fragment implements OnRetriev
textviewNoAction = (RelativeLayout) rootView.findViewById(R.id.no_action);
mainLoader.setVisibility(View.VISIBLE);
asyncTask = new RetrieveScheduledTootsAsyncTask(context, DisplayScheduledTootsFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
//Removes all scheduled toots that have sent
SQLiteDatabase db = Sqlite.getInstance(context, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
new StatusStoredDAO(context, db).removeAllSent();
return rootView;
}
@Override
public void onResume(){
super.onResume();
//Retrieves scheduled toots
asyncTask = new RetrieveScheduledTootsAsyncTask(context, DisplayScheduledTootsFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
@Override
public void onCreate(Bundle saveInstance)
{

View File

@ -36,7 +36,7 @@ import fr.gouv.etalab.mastodon.sqlite.StatusStoredDAO;
public class ScheduledTootsSyncJob extends Job {
static final String SCHEDULED_TOOT = "job_scheduled_toot";
public static final String SCHEDULED_TOOT = "job_scheduled_toot";
@NonNull
@ -76,11 +76,9 @@ public class ScheduledTootsSyncJob extends Job {
.setRequirementsEnforced(false)
.build()
.schedule();
new StatusStoredDAO(context, db).scheduleStatus(id, jobId, new Date());
new StatusStoredDAO(context, db).scheduleStatus(id, jobId, new Date(timestampScheduling));
return jobId;
}
}

View File

@ -158,6 +158,10 @@ public class StatusStoredDAO {
return db.delete(Sqlite.TABLE_STATUSES_STORED, Sqlite.COL_IS_SCHEDULED + " = \"0\" AND " + Sqlite.COL_USER_ID + " = '" + userId+ "' AND " + Sqlite.COL_INSTANCE + " = '" + instance+ "'", null);
}
public int removeAllSent(){
return db.delete(Sqlite.TABLE_STATUSES_STORED, Sqlite.COL_IS_SCHEDULED + " > 0 AND " + Sqlite.COL_SENT + " = 1", null);
}
//------- GETTERS -------
/**
@ -202,7 +206,7 @@ public class StatusStoredDAO {
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
String instance = Helper.getLiveInstance(context);
Cursor c = db.query(Sqlite.TABLE_STATUSES_STORED, null, Sqlite.COL_USER_ID + " = '" + userId+ "' AND " + Sqlite.COL_INSTANCE + " = '" + instance+ "' AND " + Sqlite.COL_IS_SCHEDULED + " > 0 AND " + Sqlite.COL_SENT + " = 0", null, null, null, Sqlite.COL_DATE_CREATION + " DESC", null);
Cursor c = db.query(Sqlite.TABLE_STATUSES_STORED, null, Sqlite.COL_USER_ID + " = '" + userId+ "' AND " + Sqlite.COL_INSTANCE + " = '" + instance+ "' AND " + Sqlite.COL_IS_SCHEDULED + " > 0 AND " + Sqlite.COL_SENT + " = 0", null, null, null, Sqlite.COL_DATE_SCHEDULED + " ASC", null);
return cursorToListStatuses(c);
} catch (Exception e) {
return null;
@ -284,7 +288,7 @@ public class StatusStoredDAO {
Status status = Helper.restoreStatusFromString(c.getString(c.getColumnIndex(Sqlite.COL_STATUS_SERIALIZED)));
storedStatus.setStatus(status);
storedStatus.setSent(c.getInt(c.getColumnIndex(Sqlite.COL_SENT)) == 1);
storedStatus.setScheduled(c.getInt(c.getColumnIndex(Sqlite.COL_IS_SCHEDULED)) > 0 );
storedStatus.setJobId(c.getInt(c.getColumnIndex(Sqlite.COL_IS_SCHEDULED)));
storedStatus.setCreation_date(Helper.stringToDate(context, c.getString(c.getColumnIndex(Sqlite.COL_DATE_CREATION))));
storedStatus.setScheduled_date(Helper.stringToDate(context, c.getString(c.getColumnIndex(Sqlite.COL_DATE_SCHEDULED))));
storedStatus.setSent_date(Helper.stringToDate(context, c.getString(c.getColumnIndex(Sqlite.COL_DATE_SENT))));
@ -311,7 +315,7 @@ public class StatusStoredDAO {
Status status = Helper.restoreStatusFromString(c.getString(c.getColumnIndex(Sqlite.COL_STATUS_SERIALIZED)));
storedStatus.setStatus(status);
storedStatus.setSent(c.getInt(c.getColumnIndex(Sqlite.COL_SENT)) == 1);
storedStatus.setScheduled(c.getInt(c.getColumnIndex(Sqlite.COL_IS_SCHEDULED)) > 0 );
storedStatus.setJobId(c.getInt(c.getColumnIndex(Sqlite.COL_IS_SCHEDULED)) );
storedStatus.setCreation_date(Helper.stringToDate(context, c.getString(c.getColumnIndex(Sqlite.COL_DATE_CREATION))));
storedStatus.setScheduled_date(Helper.stringToDate(context, c.getString(c.getColumnIndex(Sqlite.COL_DATE_SCHEDULED))));
storedStatus.setSent_date(Helper.stringToDate(context, c.getString(c.getColumnIndex(Sqlite.COL_DATE_SENT))));

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

View File

@ -38,36 +38,39 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<Button
android:id="@+id/date_time_cancel"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:text="@string/cancel"
android:layout_height="wrap_content"
android:layout_height="40dp"
tools:ignore="ButtonStyle" />
<Button
<ImageButton
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:visibility="gone"
android:id="@+id/date_time_previous"
android:layout_weight="1"
android:layout_width="0dp"
android:text="@string/previous"
android:layout_height="wrap_content"
android:layout_width="40dp"
android:src="@drawable/ic_skip_previous"
android:layout_height="40dp"
tools:ignore="ButtonStyle" />
<Button
<ImageButton
android:id="@+id/date_time_next"
android:layout_weight="1"
android:layout_width="0dp"
android:text="@string/next"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:src="@drawable/ic_skip_next"
android:layout_width="40dp"
android:layout_height="40dp"
tools:ignore="ButtonStyle" />
<Button
<ImageButton
android:visibility="gone"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:id="@+id/date_time_set"
android:layout_weight="1"
android:layout_width="0dp"
android:text="@string/save"
android:layout_height="wrap_content"
android:src="@drawable/ic_check"
android:layout_width="40dp"
android:layout_height="40dp"
tools:ignore="ButtonStyle" />
</LinearLayout>

View File

@ -23,6 +23,7 @@
android:layout_marginTop="10dp"
style="?attr/cardStyle"
card_view:cardPreventCornerOverlap="true"
android:id="@+id/scheduled_toot_container"
app:cardUseCompatPadding="true">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
@ -48,36 +49,56 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/scheduled_toot_privacy"
android:padding="10dp"
android:layout_width="25dp"
android:layout_height="25dp"
tools:ignore="ContentDescription" />
<TextView
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:id="@+id/scheduled_toot_media_count"
android:layout_width="150dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/scheduled_toot_date_creation"
android:textSize="12sp"
android:layout_marginTop="5dp"
android:textStyle="italic"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:gravity="end"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<Button
android:layout_marginTop="10dp"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:focusableInTouchMode="false"
android:id="@+id/scheduled_toot_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:visibility="gone"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:id="@+id/scheduled_toot_failed"
android:textColor="@color/red_1"
android:text="@string/failed"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
<Button
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:focusableInTouchMode="false"
android:id="@+id/scheduled_toot_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
android:id="@+id/scheduled_toot_delete"
android:src="@drawable/ic_cancel"

View File

@ -67,7 +67,7 @@
<string name="choose_file">Veuillez sélectionner un fichier</string>
<string name="choose_file_error">Aucun explorateur de fichiers trouvé !</string>
<string name="click_to_change">Cliquer sur le chemin pour changer</string>
<string name="failed">Erreur !</string>
<string name="scheduled_toots">Pouets programmés</string>
<!-- Status -->
<string name="no_status">Aucun pouet à afficher !</string>
@ -185,7 +185,7 @@
<!-- Scheduled toots -->
<string name="no_scheduled_toots">Aucun pouet programmé à afficher !</string>
<string name="no_scheduled_toots_indications">Ecrivez un toot, puis choisissez <b>Programmer</b> dans le menu du haut.</string>
<string name="no_scheduled_toots_indications">Ecrivez un pouet, puis choisissez <b>Programmer</b> dans le menu du haut.</string>
<string name="remove_scheduled">Supprimer le pouet programmé ?</string>
<string name="media_count">Média(s): %d</string>
<string name="toot_scheduled">Le pouet a été programmé !</string>

View File

@ -70,7 +70,7 @@
<string name="choose_file">Please select a file</string>
<string name="choose_file_error">No file explorer found!</string>
<string name="click_to_change">Click on the path to change it</string>
<string name="failed">Failed!</string>
<string name="scheduled_toots">Scheduled toots</string>
<!-- Status -->
<string name="no_status">No toot to display</string>