Comments (10)
Hi @nuhkoca,
Yes, it's totally possible, since the library is only generating a view. you could include it anywhere you like, here is a sample :
Create a layout file like the following.
The Linearlayout which will work as a host for our about-page view.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/main_view" ...>
<android.support.v7.widget.Toolbar .../>
</LinearLayout>
The in your activity, apply the following trick :
setContentView(R.layout.activity_about); // set your layout file normally
LinearLayout mActivityRoot = ((LinearLayout) findViewById(R.id.main_view)); // our host view
mActivityRoot.addView(aboutView, 1); // Add about-page view to position 1 (since 0 is already taken by the toolbar)
Hope that answers your question.
from android-about-page.
Hi @IdiosApps,
Please use mActivityRoot.addView(aboutPage, 1);
and try adding the layoutParams also
from android-about-page.
As @IdiosApps mentioned, following these steps give the toolbar, but the about page itself does not appear. Please help.
from android-about-page.
Thank you, it works !
from android-about-page.
I tried using the trick you shared, but I just have the toolbar and not the view we created and tried to add.
I tried
mActivityRoot.addView(aboutPage, 0); and got the aboutPage view, but no toolbar.
mActivityRoot.addView(aboutPage, 1); gives toolbar and not the aboutPage view.
mActivityRoot.addView(aboutPage); gives just the toolbar.
from android-about-page.
Hello @medyo:
I tried your last snippet to show the about content but I only see the toolbar. Position 1 shows a blank view.
I tried your recommendation to @IdiosApps with:
Activity.java
View aboutView = new AboutPage(this)
....
.create();
aboutView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
mActivityRoot.addView(aboutView, 1);
layout.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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=".AcercaDeActivity"
android:id="@+id/main_view">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
</LinearLayout>
But the result is the same. Do you know how can I solve this issue? Thanks!
from android-about-page.
Hi, I think you've an issue with LayoutParams, you need to set the right params
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
aboutView.setLayoutParams(params);
mActivityRoot.addView(aboutView, 1, params);
from android-about-page.
As you approached, it still is not working. Can you help me? @medyo
from android-about-page.
@medyo , it just doesn't work. Either you should claim that you can't present a solution or provide with a full demoable example. About page is good, but only if we can integrate into our ecosystem. It's frustrating to find blank ideas from your end. You should test before putting it.
from android-about-page.
Use TableLayout and then add the About Page as a view into the TableLayout
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
if (getSupportActionBar() != null){
getSupportActionBar().setTitle(getString(R.string.about_sapamacash));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
}//E# if statement
tableLayout = (TableLayout) findViewById(R.id.aboutLayout);
String phone = "+254722906835";
View aboutPage = new AboutPage(this)
.isRTL(false)
.setDescription(getString(R.string.about_us_text))
.addEmail("[email protected]")
.addItem(getPhoneElement(phone))
.addWebsite("https://sapamacash.com/")
.addFacebook("sapamatech")
.addTwitter("sapamatech")
.addYoutube("UCV-sIbWJ5HpO0qk6Hp7Sjfw")
.addItem(getCopyRightsElement())
.create();
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
aboutPage.setLayoutParams(params);
tableLayout.addView(aboutPage, 1,params);
}
<?xml version="1.0" encoding="utf-8"?>
<TableLayout 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="wrap_content"
tools:context=".ui.activity.AboutActivity"
android:id="@+id/aboutLayout">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"/>
</com.google.android.material.appbar.AppBarLayout>
</TableLayout>
from android-about-page.
Related Issues (20)
- font HOT 2
- Incorrect image color, iconDrawable is dark HOT 1
- Ads Implementation HOT 1
- Facebook Page: Trouble Loading HOT 2
- Google Play Rating HOT 1
- Possible To Change Image Position ?
- How do I changed the background color of the about page? HOT 3
- Add App Gallery and Galaxy Store HOT 2
- Can't Implement Image as Web link HOT 3
- Auto night mode support HOT 2
- toolbar
- Email icon isn't visible in dark mode HOT 7
- About Page android
- Font is not use by typeface
- Impact of jCenter EOL HOT 1
- iOS About Page
- Not able to load external image HOT 2
- Add Phone Element Suggestion
- Strezless
- I would like you to add LinkedIn and whatsapp HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-about-page.