An IT Man

The jack of all trades in the IT field


Best Collections Blogger Templates for Hacker Programmer Developer

For first, did you know... I had googled like an hour of the day and wasted my precious time just for looking a simple and clean template for my Blogspot, LOL!!! So many sites in the wild quoting "Simple Blogger Template" but you know what? no one of them returns the real point, they're not really simple like what I mean, it still too rich on design widget slider and another, what the heck is it.

Well, if We've the same thing on point of view then over here you go,

My list collections of "REALLY Simple Clean Blogger Templates / Themes"


I think I will simultaneously update this post when I get an another new simple clean blogger template. Okay, maybe that's all from my side. Hope it can be useful for you.

3 comments :

Post a Comment


Android Convert Activity to Fragment

Simple case porting activity to fragment.

activity_main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical">

    <TextView
            android:id="@+id/textView"
            android:text="Hello World"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>

</LinearLayout>


MainActivity.java
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

    private TextView textView;

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

        textView = (TextView) findViewById(R.id.textView);
    }

}


The result convert Activity to Fragment

MainFragment.java
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class MainFragment extends Fragment {

    private TextView textView;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.activity_main, container, false);

        textView = (TextView) rootView.findViewById(R.id.textView);

        return rootView;
    }
}



No comments :

Post a Comment


Syntax Highlighter on Blogger

There is some way to do that,

Quick

You can use online syntax highlighter, just copy your script want to format on online syntax highlighters like https://tohtml.comhttp://hilite.mehttp://markup.su/highlighter or any other tool and then re-copas (copy-paste) on your blog. You can use it as simply.


Linked

Yes, by embed! Usually, i used https://gist.github.com and https://pastebin.com.


Builtin

This is clear one explanation included screenshot you can follow as easily. http://oneqonea.blogspot.co.id/2012/04/how-do-i-add-syntax-highlighting-to-my.html


Conclusion

Choose what do you want, all its ok. Mine used Builtin and sometimes use Linked/Embed to share blog backlink haha!. If you use built in, its base on JavaScript, called on external sources. The most issue part about js is where you put your js codes, but I think it depends on your website or app. Some web apps are based on JavaScript. Then it does not make sense to include it at the bottom of the page mean before </body> tag to get load page faster but in this case, you need load it immediately. 

If JavaScript just adds some not so important features to some an another content-based page or any async task, then better load it at the end. I think it just little bit different, loading time will almost be the same, but the user will see the important parts earlier (before the page finished loading). It’s not about a whole site loading faster, but giving a user the impression of some website loading faster.


No comments :

Post a Comment


How to use icons and symbols from fonts on Android

I think it's an alternate way to reduce some resources on android development, yep bundle all icon as .ttf file (font ext). Sure it really hacky and customizable, you can change icon size by textSize change color by textColor and an another TextView syntax.

For example you can try to code with well known font, Font Awesome.

  • Copy your font (I.e. font awesome) fontawesome-webfont.ttf into assets folder, or for spesific create new directory called fonts, it will be assets/fonts.

  • Found the character entities for icons you want, if it font awesome you can use this page: http://fortawesome.github.io/Font-Awesome/cheatsheet/

  • Created an entry in strings.xml for each icon. (E.g. code)
    fa-code [&#xf121;]
  • <string name="icon_code">&#xf121;</string>
    

  • Then load on xml layout:
  • <TextView
       android:id="@+id/icCode"
       android:gravity="center"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:textSize="50dp"
       android:textColor="@color/white"
       android:text="@string/icon_code" />
    

  • Set font as appropriate Views by load it on onCreate method:
  • Typeface font = Typeface.createFromAsset( getAssets(), "fonts/fontawesome-webfont.ttf" );
            TextView tvCode = (TextView)findViewById(R.id.icCode);
            tvCode.setTypeface(font);
    

That's all, like the post title now you can load icon or symbol through included font. Overall, If it can be reduce resources but it still be time consuming.

Warning : Memory leak constantly creating new typeface   https://code.google.com/p/android/issues/detail?id=9904#c7
Showcaseshttps://bitbucket.org/informatic0re/awesome-font-iconview
String FontAwesomehttps://gist.github.com/CreatorB/3a934dc4f84d2d887bbd30fc86d1eaa3

No comments :

Post a Comment