Add reply more button hint

multisite
Floens 10 years ago
parent 7164ba0c54
commit 838d7c78f7
  1. 14
      Clover/app/src/main/java/org/floens/chan/core/presenter/ReplyPresenter.java
  2. 2
      Clover/app/src/main/java/org/floens/chan/core/settings/ChanSettings.java
  3. 6
      Clover/app/src/main/java/org/floens/chan/ui/helper/HintPopup.java
  4. 10
      Clover/app/src/main/java/org/floens/chan/ui/layout/ReplyLayout.java
  5. 2
      Clover/app/src/main/java/org/floens/chan/ui/layout/ThreadListLayout.java
  6. 1
      Clover/app/src/main/res/values/strings.xml

@ -125,6 +125,16 @@ public class ReplyPresenter implements ReplyManager.HttpCallback<ReplyHttpCall>,
closeAll();
}
public void onOpen(boolean open) {
if (open) {
callback.focusComment();
if (ChanSettings.replyOpenCounter.increase() == 2) {
callback.showMoreHint();
}
}
}
public boolean onBack() {
if (page == Page.LOADING) {
return true;
@ -438,5 +448,9 @@ public class ReplyPresenter implements ReplyManager.HttpCallback<ReplyHttpCall>,
ImagePickDelegate getImagePickDelegate();
ChanThread getThread();
void showMoreHint();
void focusComment();
}
}

@ -117,6 +117,7 @@ public class ChanSettings {
public static final CounterSetting settingsOpenCounter;
public static final CounterSetting historyOpenCounter;
public static final CounterSetting replyOpenCounter;
static {
SharedPreferences p = AndroidUtils.getPreferences();
@ -214,6 +215,7 @@ public class ChanSettings {
settingsOpenCounter = new CounterSetting(p, "counter_settings_open");
historyOpenCounter = new CounterSetting(p, "counter_history_open");
replyOpenCounter = new CounterSetting(p, "counter_reply_open");
// Old (but possibly still in some users phone)
// preference_board_view_mode default "list"

@ -19,6 +19,10 @@ public class HintPopup {
}
public static PopupWindow show(final Context context, final View anchor, final String text) {
return show(context, anchor, text, 0, 0);
}
public static PopupWindow show(final Context context, final View anchor, final String text, final int offsetX, final int offsetY) {
final LinearLayout popupView = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.popup_hint, null);
TextView textView = (TextView) popupView.findViewById(R.id.text);
@ -37,7 +41,7 @@ public class HintPopup {
@Override
public void run() {
popupView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
popupWindow.showAsDropDown(anchor, -popupView.getMeasuredWidth() + anchor.getWidth(), -dp(25));
popupWindow.showAsDropDown(anchor, -popupView.getMeasuredWidth() + anchor.getWidth() + offsetX, -dp(25) + offsetY);
}
}, 100);

@ -41,6 +41,7 @@ import org.floens.chan.core.presenter.ReplyPresenter;
import org.floens.chan.core.settings.ChanSettings;
import org.floens.chan.ui.activity.StartActivity;
import org.floens.chan.ui.drawable.DropdownArrowDrawable;
import org.floens.chan.ui.helper.HintPopup;
import org.floens.chan.ui.helper.ImagePickDelegate;
import org.floens.chan.ui.theme.ThemeHelper;
import org.floens.chan.ui.view.LoadView;
@ -151,6 +152,10 @@ public class ReplyLayout extends LoadView implements View.OnClickListener, Anima
return presenter;
}
public void onOpen(boolean open) {
presenter.onOpen(open);
}
public void bindLoadable(Loadable loadable) {
presenter.bindLoadable(loadable);
}
@ -415,6 +420,11 @@ public class ReplyLayout extends LoadView implements View.OnClickListener, Anima
return callback.getThread();
}
@Override
public void showMoreHint() {
HintPopup.show(getContext(), more, getString(R.string.reply_more_hint), dp(9), dp(4));
}
public interface ReplyLayoutCallback {
void highlightPostNo(int no);

@ -249,8 +249,8 @@ public class ThreadListLayout extends FrameLayout implements ReplyLayout.ReplyLa
if (showingThread != null && replyOpen != open) {
this.replyOpen = open;
int height = AnimationUtils.animateHeight(reply, replyOpen, getWidth(), 500);
reply.onOpen(open);
if (open) {
reply.focusComment();
recyclerView.setPadding(recyclerView.getPaddingLeft(), recyclerViewTopPadding + height, recyclerView.getPaddingRight(), recyclerView.getPaddingBottom());
} else {
AndroidUtils.hideKeyboard(reply);

@ -262,6 +262,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<string name="reply_error">Error posting</string>
<string name="reply_success">Post successful</string>
<string name="reply_captcha_text">Type the text</string>
<string name="reply_more_hint">More options here!</string>
<string name="delete_confirm">Delete your post?</string>
<string name="delete_wait">Deleting post&#8230;</string>

Loading…
Cancel
Save