-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ivan Del Pino <idelpino@teclib.com>
- Loading branch information
Showing
4 changed files
with
185 additions
and
5 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
app/src/main/java/org/flyve/inventory/agent/adapter/ViewPagerAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package org.flyve.inventory.agent.adapter; | ||
|
||
import android.support.v4.app.Fragment; | ||
import android.support.v4.app.FragmentManager; | ||
import android.support.v4.app.FragmentPagerAdapter; | ||
|
||
import org.flyve.inventory.agent.ui.FragmentHelp; | ||
|
||
public class ViewPagerAdapter extends FragmentPagerAdapter { | ||
|
||
public ViewPagerAdapter(FragmentManager fm) { | ||
super(fm); | ||
} | ||
|
||
@Override | ||
public Fragment getItem(int position) { | ||
Fragment fragment = null; | ||
if (position == 0) { | ||
fragment = new FragmentHelp(); | ||
} else if (position == 1) { | ||
fragment = new FragmentHelp(); | ||
} else if (position == 2) { | ||
fragment = new FragmentHelp(); | ||
} | ||
return fragment; | ||
} | ||
|
||
@Override | ||
public int getCount() { | ||
return 3; | ||
} | ||
|
||
@Override | ||
public CharSequence getPageTitle(int position) { | ||
String title = null; | ||
if (position == 0) { | ||
title = "Tab-1"; | ||
} else if (position == 1) { | ||
title = "Tab-2"; | ||
} else if (position == 2) { | ||
title = "Tab-3"; | ||
} | ||
return title; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
app/src/main/java/org/flyve/inventory/agent/ui/FragmentInventoryList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright Teclib. All rights reserved. | ||
* | ||
* Flyve MDM is a mobile device management software. | ||
* | ||
* Flyve MDM 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. | ||
* | ||
* Flyve MDM 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. | ||
* ------------------------------------------------------------------------------ | ||
* @author Rafael Hernandez | ||
* @copyright Copyright Teclib. All rights reserved. | ||
* @license GPLv3 https://www.gnu.org/licenses/gpl-3.0.html | ||
* @link https://github.com/flyve-mdm/android-mdm-agent | ||
* @link https://flyve-mdm.com | ||
* ------------------------------------------------------------------------------ | ||
*/ | ||
|
||
package org.flyve.inventory.agent.ui; | ||
|
||
import android.os.Bundle; | ||
import android.support.annotation.NonNull; | ||
import android.support.v4.app.Fragment; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.webkit.WebView; | ||
|
||
import org.flyve.inventory.agent.R; | ||
import org.flyve.inventory.agent.core.help.Help; | ||
import org.flyve.inventory.agent.core.help.HelpPresenter; | ||
import org.flyve.inventory.agent.utils.Helpers; | ||
|
||
public class FragmentInventoryList extends Fragment implements Help.View { | ||
|
||
/** | ||
* Instantiate the user interface View | ||
* @param inflater inflater the object that can be used to inflate any views in the fragment | ||
* @param container the parent View the fragment's UI should be attached to | ||
* @param savedInstanceState this fragment is being re-constructed from a previous saved state | ||
* @return View the View for the fragment's UI | ||
*/ | ||
@Override | ||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, | ||
Bundle savedInstanceState) { | ||
|
||
// Inflate the layout for this fragment | ||
View v = inflater.inflate(R.layout.fragment_help, container, false); | ||
|
||
Help.Presenter presenter = new HelpPresenter(this); | ||
|
||
WebView wv = v.findViewById(R.id.webview); | ||
presenter.loadWebsite(FragmentInventoryList.this.getActivity(), wv, ""); | ||
|
||
return v; | ||
} | ||
|
||
@Override | ||
public void showError(String message) { | ||
Helpers.snackClose(getActivity(), message, getString(R.string.permission_snack_ok), true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<android.support.v7.widget.Toolbar | ||
android:id="@+id/toolbar" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:minHeight="?android:attr/actionBarSize"> | ||
|
||
<RelativeLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/menu_show_inventory" | ||
android:textColor="@color/black" | ||
android:textSize="18sp" /> | ||
</RelativeLayout> | ||
|
||
</android.support.v7.widget.Toolbar> | ||
|
||
<android.support.design.widget.TabLayout | ||
android:id="@+id/tabs" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_below="@+id/toolbar" | ||
android:background="@color/blue" | ||
app:tabGravity="fill" | ||
app:tabMode="fixed" | ||
app:tabTextColor="@color/white" /> | ||
|
||
<android.support.v4.view.ViewPager | ||
android:id="@+id/viewPager" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:layout_below="@+id/tabs" | ||
app:layout_behavior="@string/appbar_scrolling_view_behavior" /> | ||
|
||
<ProgressBar | ||
android:id="@+id/pb" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_centerHorizontal="true" | ||
android:layout_centerVertical="true" | ||
android:visibility="gone" /> | ||
|
||
<android.support.design.widget.FloatingActionButton | ||
android:id="@+id/btnShare" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_alignParentBottom="true" | ||
android:layout_alignParentRight="true" | ||
android:layout_margin="20dp" | ||
android:src="@drawable/ic_share_white_24dp" /> | ||
|
||
</RelativeLayout> |