Skip to content

Commit

Permalink
Replace opening Freenet main page with bootstrap site (#69)
Browse files Browse the repository at this point in the history
* Replace opening Freenet main page with bootstrap site
  • Loading branch information
desyncr authored Mar 7, 2021
1 parent e055a52 commit 990fdea
Show file tree
Hide file tree
Showing 12 changed files with 207 additions and 9 deletions.
6 changes: 6 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
android:label="@string/title_activity_settings"
android:parentActivityName=".ui.main.activity.MainActivity" />

<activity
android:name=".ui.bootstrap.activity.BootstrapActivity"
android:label=""
android:theme="@style/AppTheme.NoActionBar"
android:parentActivityName=".ui.main.activity.MainActivity" />

<service
android:name=".services.node.Service"
android:enabled="true"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/assets/css/tailwind/tailwind-theme.min.css

Large diffs are not rendered by default.

Binary file added app/src/main/assets/img/background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/img/favicon.ico
Binary file not shown.
Binary file added app/src/main/assets/img/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
136 changes: 136 additions & 0 deletions app/src/main/assets/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Freenet Mobile</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="css/tailwind/tailwind-theme.min.css">
<link href="img/favicon.png" rel="icon" type="image/png">
</head>
<body class="antialiased bg-body text-body font-body">
<header>
<nav class="bg-white shadow">
<div class="container mx-auto px-6 py-3 ">
<div class="md:flex md:items-center md:justify-between">
<div class="flex justify-between items-center">
<div class="text-xl font-semibold text-gray-700">
<a href="#" class="text-gray-800 text-xl font-bold hover:text-gray-700 md:text-2xl">
<img src="img/logo.png" alt="Freenet" style="max-height: 25px; display:inline">
FREENET</a>
</div>
</div>
</div>
</div>
</nav>

<div class="w-full bg-cover bg-center" style="height:22rem; background-image: url(img/background.jpg);">
<div class="flex items-center h-full w-full bg-gray-900 bg-opacity-50 px-4 px-10 mx-auto md:px-32 lg:px-16">
<div>
<h1 class="py-5 block text-5xl font-extrabold tracking-tight text-left text-white leading-tightest md:leading-10 m:leading-none md:text-6xl lg:text-7xl">
<span>Navigate with Freedom.</span>
</h1>
<a class="text-center block md:inline px-10 py-2 text-gray-200 bg-blue-600 rounded-full shadow-md text-lg hover:bg-blue-800 hover:border-red" href="https://freenetproject.org/pages/documentation.html#understand">See how it works</a>
<a class="text-center block md:inline px-2 py-2 sm:py-10 text-gray-200 rounded-full text-lg" href="#what-s-next">What's next?</a>
</div>
</div>

</div>
</header>

<section class="py-5 max-w-6xl m-auto px-5">
<h2 id="what-s-next" class="mb-4 text-center text-3xl font-bold leading-tight tracking-tight sm:text-4xl font-heading">What's next?</h2>
</section>

<section class="py-5 max-w-6xl m-auto px-5">

<div class="flex flex-col sm:flex-row">
<div class="w-full mb-10 md:w-1/3 min-h-56 px-6">
<svg class="h-12 w-12 text-blue-400 block m-auto mb-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>

<h3 class="font-extrabold text-gray-900 text-lg">Communicate</h3>
<div class="text-gray-500 text-base mt-3 leading-loose">
<ul class="list-none md:list-disc">
<li><a href="http://127.0.0.1:8888/friends/">Connect to your peers on Freenet! »</a></li>
<li><a href="http://127.0.0.1:8888/chat/">Find and join your comunity! »</a></li>
</ul>
</div>
</div>
<div class="w-full mb-10 md:w-1/3 min-h-56 px-6">
<svg class="h-12 w-12 text-green-400 block m-auto mb-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20" /> <path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z" />
</svg>
<h3 class="font-extrabold text-gray-900 text-lg"><a href="https://freenetproject.org/pages/documentation.html">Learn »</a></h3>
<div class="text-gray-500 text-base mt-3 leading-loose">
<ul class="list-none md:list-disc">
<li><a href="https://freenetproject.org/pages/help.html#technical">Learn how Freenet protects you online »</a></li>
<li><a href="https://freenetproject.org/pages/help.html#security">How to protect your privacy online »</a></li>
</ul>
</div>
</div>
<div class="w-full mb-10 md:w-1/3 min-h-56 px-6">
<svg class="h-12 w-12 text-yellow-400 block m-auto mb-5" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z"/> <path d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" /> <circle cx="12" cy="12" r="3" />
</svg>
<h3 class="font-extrabold text-gray-900 text-lg">Administration</h3>
<div class="text-gray-500 text-base mt-3 leading-loose">
<ul class="list-none md:list-disc">
<li><a href="http://127.0.0.1:8888/config/node">Configure Security and Network »</a></li>
<li><a href="http://127.0.0.1:8888/plugins">Install plugins to enhance Freenet »</a></li>
<li><a href="http://127.0.0.1:8888/">Go to Admin Dashboard »</a></li>
</ul>
</div>
</div>
</div>
</section>

<section class="py-20 bg-gray-50">
<div class="container items-center max-w-6xl px-4 px-10 mx-auto sm:px-20 md:px-32 lg:px-16">
<div class="flex flex-wrap items-center -mx-3">
<div class="order-1 w-full px-3 lg:w-1/2 lg:order-0">
<div class="w-full lg:max-w-md">
<h2 class="mb-4 text-3xl font-bold leading-tight tracking-tight sm:text-4xl font-heading">
Appeal for donations
</h2>
<p class="mb-4 font-medium tracking-tight text-gray-600 xl:mb-6">
We are extremely excited for the future of Freenet and the projects built on top of it. There is so much more work to do, and full-time developers greatly benefit the project.
</p>

<p class="mb-4 font-medium tracking-tight text-gray-600 xl:mb-6">
Help us keep Internet freedom alive and expand human liberty.
</p>
<p>
<a class="px-10 py-2 text-gray-200 bg-blue-600 rounded-full shadow-md text-lg hover:bg-blue-800 hover:border-red" href="https://freenetproject.org/pages/donate.html#how">How can I donate?</a>
<a class="px-10 py-2 text-gray-600 rounded-full text-lg" href="https://freenetproject.org/pages/donate.html#why">Why donate?</a>
</p>
</div>
</div>
<div class="w-full px-3 mb-12 lg:w-1/2 order-0 lg:order-1 lg:mb-0"><img class="mx-auto sm:max-w-sm lg:max-w-full" src="https://cdn.devdojo.com/images/november2020/feature-graphic.png" alt="feature image"></div>
</div>
</div>
</section>
<footer class="text-gray-700 bg-white body-font" >
<div class="container flex flex-col items-center px-8 py-8 mx-auto max-w-7xl sm:flex-row">
<a href="#_" class="text-xl font-black leading-none text-gray-900 select-none logo">FREENET</a>
<p class="mt-4 text-sm text-gray-500 sm:ml-4 sm:pl-4 sm:border-l sm:border-gray-200 sm:mt-0">&#127279; 2021 Freenet Mobile</p>
<span class="inline-flex justify-center mt-4 space-x-5 sm:ml-auto sm:mt-0 sm:justify-start">
<a href="https://twitter.com/freenetproject" class="text-gray-400 hover:text-gray-500">
<span class="sr-only">Twitter</span>
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path d="M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84" />
</svg>
</a>

<a href="https://github.com/freenetproject" class="text-gray-400 hover:text-gray-500">
<span class="sr-only">GitHub</span>
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd" />
</svg>
</a>
</span>
</div>
</footer>

</body>
</html>
2 changes: 2 additions & 0 deletions app/src/main/assets/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Allow: /
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.freenetproject.mobile.ui.bootstrap.activity;

import android.os.Bundle;
import android.webkit.WebView;

import androidx.appcompat.app.AppCompatActivity;

import org.freenetproject.mobile.R;

public class BootstrapActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bootstrap);

WebView wv = (WebView) findViewById(R.id.bootstrap_webview);
wv.loadUrl("file:///android_asset/index.html");

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand All @@ -22,6 +20,7 @@
import org.freenetproject.mobile.R;
import org.freenetproject.mobile.services.node.Manager;
import org.freenetproject.mobile.ui.about.activity.AboutActivity;
import org.freenetproject.mobile.ui.bootstrap.activity.BootstrapActivity;
import org.freenetproject.mobile.ui.acknowledgement.activity.AcknowledgementActivity;
import org.freenetproject.mobile.ui.acknowledgement.activity.AcknowledgementFragment;
import org.freenetproject.mobile.ui.main.viewmodel.MainViewModel;
Expand Down Expand Up @@ -130,13 +129,9 @@ private void updateStatusDetail(Manager m, View view) {
if (status.equals(Manager.Status.STARTED)) {
detailText.setText(R.string.tap_to_navigate);
detailText.setOnClickListener(view12 -> {
Uri uri = Uri.parse(
view.getContext().getString(R.string.default_url)
);

startActivity(
new Intent(Intent.ACTION_VIEW).setData(uri)
);
startActivity(
new Intent(getContext(), BootstrapActivity.class)
);
});
} else if (status.equals(Manager.Status.STARTING_UP)) {
detailText.setText(R.string.may_take_a_while);
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/res/layout/activity_bootstrap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.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"
android:layout_height="match_parent"
tools:context=".ui.bootstrap.activity.BootstrapActivity">

<WebView
android:id="@+id/bootstrap_webview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
21 changes: 21 additions & 0 deletions app/src/main/res/layout/content_bootstrap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

<TextView
android:id="@+id/textview_bootstrap"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

0 comments on commit 990fdea

Please sign in to comment.