Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add persian translate #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.secuso.privacyfriendlyactivitytracker">

<supports-screens
Expand All @@ -25,7 +26,9 @@
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true"/>
android:xlargeScreens="true"
android:supportsRtl="true"
tools:ignore="RtlEnabled" />

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
*/
package org.secuso.privacyfriendlyactivitytracker.activities;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;
import android.widget.ExpandableListView;

import org.secuso.privacyfriendlyactivitytracker.R;
Expand All @@ -35,6 +37,7 @@

public class HelpActivity extends BaseActivity {

@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -51,10 +54,15 @@ protected void onCreate(Bundle savedInstanceState) {
generalExpandableListView.setAdapter(expandableListAdapter);

overridePendingTransition(0, 0);

getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not necessary .. the layout will just adjust itself if edited propperly. This should not be set by default.



}

@Override
protected int getNavigationDrawerID() {
return R.id.menu_help;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
* @version 20161214
*/

public class MainActivity extends BaseActivity implements DailyReportFragment.OnFragmentInteractionListener, WeeklyReportFragment.OnFragmentInteractionListener, MonthlyReportFragment.OnFragmentInteractionListener {
public class MainActivity extends BaseActivity implements DailyReportFragment.
OnFragmentInteractionListener,
WeeklyReportFragment.OnFragmentInteractionListener,
MonthlyReportFragment.OnFragmentInteractionListener {


@Override
Expand All @@ -47,18 +50,21 @@ protected void onCreate(Bundle savedInstanceState) {
PreferenceManager.setDefaultValues(this, R.xml.pref_notification, false);

// Load first view
final android.support.v4.app.FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, new MainFragment(), "MainFragment");
final android.support.v4.app.FragmentTransaction fragmentTransaction
= getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, new
MainFragment(), "MainFragment");
fragmentTransaction.commit();

// Start step detection if enabled and not yet started
StepDetectionServiceHelper.startAllIfEnabled(this);
//Log.i(LOG_TAG, "MainActivity initialized");

}

@Override
protected int getNavigationDrawerID() {
return R.id.menu_home;
}


}
15 changes: 10 additions & 5 deletions app/src/main/res/layout/activity_help.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,20 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
tools:openDrawer="start"

<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
>

<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
Expand Down Expand Up @@ -55,9 +59,10 @@
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:layout_gravity="right"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this changed? "start" is correct here. It will automatically adjust if a rtl language is active as the start would then be on the right side.

android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/menu_main" />
app:menu="@menu/menu_main"
/>

</android.support.v4.widget.DrawerLayout>
7 changes: 5 additions & 2 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
tools:openDrawer="start"
android:layout_gravity="right"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again .. hardcoded right... should be "start"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when we change language to Persian everything is fine except one and thats navigation drawer its better to open from rtl but its not i just want to change it from ltr to rtl

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For it to work properly and not break existing languages you should use the direction independent values "start" and "end" they are basically "left" and "right" but they switch around whenever an rtl language is active..

>

<include
layout="@layout/app_bar_main"
Expand Down
Loading