mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-13 07:44:11 +01:00
Cleanup & text changes
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
2916dea6d0
commit
7181a51f1b
@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Nextcloud Talk application
|
||||
*
|
||||
* @author Mario Danic
|
||||
* Copyright (C) 2017 Mario Danic <mario@lovelyhq.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.events;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BottomSheetLockEvent {
|
||||
public final boolean cancelable;
|
||||
public final int delay;
|
||||
public final boolean shouldRefreshData;
|
||||
public final boolean cancel;
|
||||
public boolean dismissView;
|
||||
|
||||
public BottomSheetLockEvent(boolean cancelable, int delay, boolean shouldRefreshData,
|
||||
boolean cancel) {
|
||||
this.cancelable = cancelable;
|
||||
this.delay = delay;
|
||||
this.shouldRefreshData = shouldRefreshData;
|
||||
this.cancel = cancel;
|
||||
this.dismissView = true;
|
||||
}
|
||||
|
||||
public BottomSheetLockEvent(boolean cancelable, int delay, boolean shouldRefreshData,
|
||||
boolean cancel, boolean
|
||||
dismissView) {
|
||||
this.cancelable = cancelable;
|
||||
this.delay = delay;
|
||||
this.shouldRefreshData = shouldRefreshData;
|
||||
this.cancel = cancel;
|
||||
this.dismissView = dismissView;
|
||||
}
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Nextcloud Talk application
|
||||
*
|
||||
* @author Mario Danic
|
||||
* Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.interfaces
|
||||
|
||||
import android.os.Bundle
|
||||
|
||||
interface ConversationMenuInterface {
|
||||
fun openLovelyDialogWithIdAndBundle(
|
||||
dialogId: Int,
|
||||
bundle: Bundle
|
||||
)
|
||||
}
|
@ -22,6 +22,5 @@ package com.nextcloud.talk.interfaces
|
||||
|
||||
interface SelectionInterface {
|
||||
fun toggleBrowserItemSelection(path: String)
|
||||
|
||||
fun isPathSelected(path: String): Boolean
|
||||
}
|
||||
|
@ -1,111 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.nextcloud.talk.utils.animations;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.nextcloud.talk.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class FABAwareScrollingViewBehavior extends AppBarLayout.ScrollingViewBehavior {
|
||||
|
||||
private boolean slidingDown = false;
|
||||
private int searchBarHeight;
|
||||
|
||||
public FABAwareScrollingViewBehavior() {
|
||||
}
|
||||
|
||||
public FABAwareScrollingViewBehavior(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void layoutChild(@NonNull CoordinatorLayout parent, @NonNull View child, int layoutDirection) {
|
||||
if (child.getId() == R.id.searchCardView) {
|
||||
searchBarHeight = child.getHeight();
|
||||
}
|
||||
super.layoutChild(parent, child, layoutDirection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean layoutDependsOn(CoordinatorLayout parent, View child, View dependency) {
|
||||
return super.layoutDependsOn(parent, child, dependency) ||
|
||||
dependency instanceof FloatingActionButton;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onStartNestedScroll(final CoordinatorLayout coordinatorLayout, final View child,
|
||||
final View directTargetChild, final View target, final int nestedScrollAxes) {
|
||||
// Ensure we react to vertical scrolling
|
||||
return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL
|
||||
|| super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target,
|
||||
nestedScrollAxes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNestedScroll(final CoordinatorLayout coordinatorLayout, final View child,
|
||||
final View target, final int dxConsumed, final int dyConsumed,
|
||||
final int dxUnconsumed, final int dyUnconsumed) {
|
||||
//super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed,
|
||||
// dyUnconsumed);
|
||||
if (dyConsumed > 0) {
|
||||
// User scrolled down -> hide the FAB
|
||||
List<View> dependencies = coordinatorLayout.getDependencies(child);
|
||||
for (View view : dependencies) {
|
||||
if (view instanceof FloatingActionButton) {
|
||||
((FloatingActionButton) view).hide();
|
||||
} else if (view.getId() == R.id.searchCardView) {
|
||||
//slideUp(child);
|
||||
}
|
||||
}
|
||||
} else if (dyConsumed < 0) {
|
||||
// User scrolled up -> show the FAB
|
||||
List<View> dependencies = coordinatorLayout.getDependencies(child);
|
||||
for (View view : dependencies) {
|
||||
if (view instanceof FloatingActionButton) {
|
||||
((FloatingActionButton) view).show();
|
||||
} else if (view.getId() == R.id.searchCardView) {
|
||||
//slideDown(view);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void slideUp(View child) {
|
||||
if (slidingDown) {
|
||||
slidingDown = false;
|
||||
child.clearAnimation();
|
||||
child.animate().translationY(0).setDuration(200);
|
||||
}
|
||||
}
|
||||
|
||||
private void slideDown(View child) {
|
||||
if (!slidingDown) {
|
||||
slidingDown = true;
|
||||
child.clearAnimation();
|
||||
child.animate().translationY(searchBarHeight).setDuration(200);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,79 +0,0 @@
|
||||
/*
|
||||
* Nextcloud Talk application
|
||||
*
|
||||
* @author Mario Danic
|
||||
* Copyright (C) 2018 Mario Danic <mario@lovelyhq.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* The original code is Copyright (c) 2016 Srijith Narayanan under MIT licence
|
||||
* https://github.com/sjthn/BottomNavigationViewBehavior/blob/9558104a16a1276bd8a73fba6736d88cd25b5488/app/src/main/java/com/example/srijith/bottomnavigationviewbehavior/BottomNavigationViewBehavior.java
|
||||
* and of course modified by yours truly.
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.utils.animations;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
|
||||
public class ViewHidingBehaviourAnimation extends AppBarLayout.ScrollingViewBehavior {
|
||||
|
||||
private int height;
|
||||
private boolean slidingDown = false;
|
||||
|
||||
@Override
|
||||
public boolean onLayoutChild(CoordinatorLayout parent, View child, int layoutDirection) {
|
||||
height = child.getHeight();
|
||||
return super.onLayoutChild(parent, child, layoutDirection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onStartNestedScroll(@NonNull CoordinatorLayout coordinatorLayout,
|
||||
@NonNull View child, @NonNull View directTargetChild, @NonNull View
|
||||
target, int nestedScrollAxes) {
|
||||
return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNestedScroll(@NonNull CoordinatorLayout coordinatorLayout, @NonNull View child,
|
||||
@NonNull View target, int dxConsumed, int
|
||||
dyConsumed, int dxUnconsumed, int dyUnconsumed) {
|
||||
if (dyConsumed > 0) {
|
||||
slideDown(child);
|
||||
} else if (dyConsumed < 0) {
|
||||
slideUp(child);
|
||||
}
|
||||
}
|
||||
|
||||
private void slideUp(View child) {
|
||||
if (slidingDown) {
|
||||
slidingDown = false;
|
||||
child.clearAnimation();
|
||||
child.animate().translationY(0).setDuration(200);
|
||||
}
|
||||
}
|
||||
|
||||
private void slideDown(View child) {
|
||||
if (!slidingDown) {
|
||||
slidingDown = true;
|
||||
child.clearAnimation();
|
||||
child.animate().translationY(height).setDuration(200);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Nextcloud Talk application
|
||||
*
|
||||
* @author Mario Danic
|
||||
* Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.utils.singletons;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
public class ApplicationWideMessageHolder {
|
||||
private static final ApplicationWideMessageHolder holder = new ApplicationWideMessageHolder();
|
||||
private MessageType messageType;
|
||||
|
||||
public static ApplicationWideMessageHolder getInstance() {
|
||||
return holder;
|
||||
}
|
||||
|
||||
public MessageType getMessageType() {
|
||||
return messageType;
|
||||
}
|
||||
|
||||
public void setMessageType(@Nullable MessageType messageType) {
|
||||
this.messageType = messageType;
|
||||
}
|
||||
|
||||
public enum MessageType {
|
||||
WRONG_ACCOUNT, ACCOUNT_UPDATED_NOT_ADDED, ACCOUNT_SCHEDULED_FOR_DELETION, SERVER_WITHOUT_TALK,
|
||||
FAILED_TO_IMPORT_ACCOUNT, ACCOUNT_WAS_IMPORTED, CALL_PASSWORD_WRONG
|
||||
}
|
||||
}
|
@ -349,7 +349,7 @@
|
||||
<string name="silenced_by_moderator">You were silenced by a moderator</string>
|
||||
<string name="nc_failed_to_send">Failed to send - tap to retry sending.</string>
|
||||
<string name="nc_preferences">Preferences</string>
|
||||
<string name="nc_look_and_feel">Theme&Sounds</string>
|
||||
<string name="nc_look_and_feel">Appearance & Sounds</string>
|
||||
<string name="nc_settings_calls_sound">Calls sound</string>
|
||||
<string name="nc_settings_notifications_sound">Notifications sound</string>
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user