Android project development practice (2)-constellation display 12 cells, Android Palace

Source: Internet
Author: User

Android project development practice (2)-constellation display 12 cells, Android Palace

I haven't written about Android for many days. Today I continue my unfinished Android project. Today, we mainly achieve the 12-cell constellation effect.

1. constellation pictures

Find 12 constellation pictures, see res/drawable directory under the project code

2. It is necessary to establish this enumeration class for Constellation enumeration class, which can make our code clearer and avoid magic numbers. The code for the enumeration class is as follows:
Package com. liuc. constatntEnum; import com. liuc. r;/*** constellation enumeration ** @ author Administrator **/public enum ConstellationEnum {// constellation number (parameter description // 0: Aries, 1: Taurus, 2: gemini, 3: cancer, 4: Leo, // 5: Virgo, 6: Libra, 7: Scorpio, 8: Sagittarius, 9: Capricorn, // 10: Aquarius, 11: PISCES) Aries (0, "Aries", R. drawable. aries), Taurus (1, "Taurus", R. drawable. taurus), Gemini (2, "Gemini", R. drawable. gemini), Cancer (3, "Cancer", R. drawable. cancer), Leo (4, "Leo", R. drawable. leo), Virgo (5, "Virgo", R. drawable. virgo), Libra (6, "Libra", R. drawable. libra), Scorpio (7, "Scorpio", R. drawable. scorpio), Sagittarius (8, "Sagittarius", R. drawable. sagittarius), Capricorn (9, "Capricorn", R. drawable. capricorn), Aquarius (10, "Aquarius", R. drawable. aquarius), Pisces (11, "Pisces", R. drawable. pisces); private ConstellationEnum (int constellationID, String name, int imageID) {this. constellationID = constellationID; this. name = name; this. imageID = imageID;} private int constellationID; // constellation IDprivate String name; // constellation name private int imageID; // constellation image resource IDpublic int getImageID () {return imageID ;} public int getConstellationID () {return constellationID;} public String getName () {return name ;}}
3. The layout of the 12 cells in the main interface uses the GridView as the container. The layout of the main interface is displayed in the ImageView + TextView mode in each grid:
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:orientation="vertical" >       <GridView       android:id="@+id/constellation_gridView"      android:layout_width="fill_parent"      android:layout_height="fill_parent"      android:numColumns="3"      android:columnWidth="90dp"      android:stretchMode="columnWidth"      android:gravity="center">      </GridView>    </RelativeLayout>

The layout XML of each grid:
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="fill_parent"    android:layout_height="wrap_content"     >    <ImageView         android:id="@+id/imageView"        android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:layout_centerHorizontal="true"        />        <TextView         android:id="@+id/item_text"        android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:layout_centerHorizontal="true"    android:layout_below="@+id/imageView"        /></RelativeLayout>
4. initialize the layout of MainActivity
/*** Load the 12 constellation layout on the home page */private void loadTwelveConstellation () {GridView gridview = (GridView) this. findViewById (R. id. constellation_gridView); List <Map <String, Object> list = new ArrayList <Map <String, Object> (); for (ConstellationEnum constellation: ConstellationEnum. values () {Map <String, Object> map = new HashMap <String, Object> (); map. put ("itemImage", constellation. getImageID (); map. put ("itemText ", Constellation. getName (); list. add (map);} SimpleAdapter adapter = new SimpleAdapter (this, list, R. layout. itemmenu, new String [] {"itemImage", "itemText"}, new int [] {R. id. imageView, R. id. item_text}); // Add the Item to the grid gridview. setAdapter (adapter); // Add the Click Event gridview. setOnItemClickListener (new OnItemClickListener () {@ Overridepublic void onItemClick (AdapterView <?> Parent, View view, int position, long id ){}});}
So far, the layout of a 12-palace grid is complete. The interface effect is as follows: I tested three mobile phones, and the 5.1-inch screen can be displayed on the whole screen. the scroll bar will appear on two 4.3 screens... The adaptive Display Based on the screen will be modified in the final code version.
Address: http://download.csdn.net/detail/shanhuhau/8065877



What is the significance of the Constellation 2-12 Palace?

Significance of the 12th Palace
The 12th Palace, that is, the 12th Palace Of The Day After Tomorrow (that is, the 12th Palace of the Zodiac), is the area in the sky relative to the Zodiac constellation, depending on the place of birth and time of birth. Different "houtiangu" represents different areas of activity, and some planets that appear in the "houtiangu" change their meaning.
As there are only 10 planets, some "post-tiangu" will not appear. However, this does not mean that the "houtiangu" is useless because other factors, such as the sensor points and the North-South Point of the Moon, may also affect the explicit meaning of the "houtiangu.
Apply the example given by the astrology experts: "The planet is an actor; the constellation is an actor role; and The tiangu is the one that the role is invested in .』

Special houtiangu

The first palace (Asc) is called the palace of life or the rising constellation. The rising point is located at the east end of the horizon, where the sun rises.
Des is called the fallen constellation. Located at the west end of the horizon, where the sun is sunk.
The tenth Palace (MC) is called Zhongtian or tianding. It is located at the top or southern end of the star disk.
The fourth Palace (IC) is opposite to the tenth Palace. Located at the bottom or North end of the star disk.

The 12th Palace of the day after tomorrow

The first palace (the palace of life, that is, "Aries 』)

Introduction
This is a palace of "fertility". The first Palace is the palace of life 』. The palace shows the constellation and its degree at birth, that is, the rising constellation.
Due to the rotation of the Earth, the yellow track surface will rise at the horizon in about four minutes. Therefore, when calculating the rising constellation, the accuracy of birth time is quite high.
Symbolic Meaning
The first palace shows your personality, temperament, disposition, uniqueness, and methods of expressing yourself. It also shows how others treat you and how you want others to treat you. It also shows your shape, health, and years of the year. It shows your views on life and the world. It also shows your appearance, behavior, and career start. At the same time, it also affects your impression on others.

Second Palace (the palace of wealth, that is, "Taurus 』)

Introduction
This is a palace of material and resources.
Symbolic Meaning
The second palace represents the economic condition, property (except real estate), ability to invest, make money, and handle money. It represents your inner talent and intelligence, your actual needs, self-value and value. It is also a "houtiangu" that represents freedom 』.

Third Palace (brother Palace, that is, "Gemini 』)

Introduction
This is a palace of "Mind" and "communication.
Symbolic Meaning
The third palace represents your living environment, your siblings, neighbors, and communication with others. It represents short-term travel. It also shows your mind, language ability, knowledge, and early education.

The fourth Palace (tiazu, also known as "cancer 』)

Introduction
This is a palace of emotion.
Symbolic Meaning
The fourth palace represents your family, parents, and root causes, that is, your inheritance, heritage, psychological root, and subconscious. It also represents real estate and housing. It also represents the end, such as the life of old age, the grave and the reputation after death. It also shows the influence of your parents on you during your childhood. It also represents your own and subjective views.

Fifth Palace (the daughter's palace, or "Leo 』)

Introduction
This is the palace of life.
Symbolic Meaning
The fifth palace represents children, love, romance, entertainment, holidays, games, bets, hobbies and sideline. It represents your creativity and artistic talent. It also represents an emotional expression. It also represents the education of early childhood, politics, pure art, social networking, pregnancy and children.

The sixth Palace (the servant Palace, that is, the "private seat 』)

Introduction
This is a palace of material.
Symbolic Meaning
The sixth house represents your work, health, and habits. It shows the status of subordinates and slaves. It also shows the services, clothing, and health you provide to others. This palace also represents the elders such as the uncle and the unconscious part of the mind.

Seventh Palace (Husband and wife, or "Libra 』)

Introduction
This is a palace of "face-to-face relationships.
Symbolic Meaning
The 7th palace represents trade, spouse, marriage, divorce, contract, law, litigation, transactions, agreements, shareholders, partners and all dealings with the public and public response. It represents your enemies and the most lacking part. It also represents your attitude towards marriage and marital status. At the same time, it also indicates any sponsorship or replacement for you outside of your grandparents... the remaining full text>
 
What is my zodiac sign?

Taurus April 20 ~ May 20

Basic Information

April 21-5-20 (because of the different division of the year, the person born in April 20 may be Taurus or Aries. For example, Hitler was born at on January 1, April 20, 1889. At this time, the sun entered the palace, so it was Taurus. Therefore, when you are born at the beginning or end of the constellation period, you should check the constellation exchange day of the current year to accurately determine your constellation)
Attribute: Earth elephant Constellation
Gixiang things: Holy beetle statue
Auspicious metal: Copper
Auspicious GEM: coral
Auspicious plants: peony, calendula, spring, Violet, and wild flowers
Auspicious day: Friday
Auspicious color: Golden
Lucky week: Friday
Birthstone: emerald green (transformation, Disaster Tolerance, and enhanced learning ability)
Guardian Stone: pink crystal (Enhancing imagination and calming down emotions)
Lucky GEM: Sapphire
Suitable for apparel: the "YSL" type that is elegant, simple, unpretentious, and tasteful
Luxury brands: GIVENCHY
Popularity sensitivity: Practical popularity
The most important dates of each month: 1, 10, and 19
Suitable for: fashion designers, large enterprises, carving art, singing actors, entrepreneurs, politicians
Suitable for mood accessories: necklaces
LUCKY: 6, 15, 24, 33
Auspicious plants: hyacinth, calendula, Violet, and tulip
Favorable Conditions: Flattering, intelligent, and tasteful
Unfavorable condition: inactive and stubborn
The symbol of Taurus symbolizes the head of the ox. Its guardian star Is Venus, and the patron saint is the goddess of love and beauty-Venus.
The second constellation of the Zodiac is Taurus, and the bull represents animals. Taurus is the constellation that can be seen in the southern middle of the sun at dusk in late January, and forms a bow-like Taurus. one of the brightest silver stars is the right eye of Taurus. It has always been known for its power, and has something to do with occasional wild, occasional quiet natural power. The sun will be in the beautiful season of spring flowers during the period from 4/20 to 5/20 of this constellation. Taurus people born at this time not only have the spirit of beauty and reconciliation, but also are gentle and amiable, and like nature.
Features

Good eloquence
Your mind is sharp and agile, but thinking too fast often makes you restless and impatient. You will have a romantic, ironic sense of humor and eloquent talent.
Good at communication
It has flexible and euphemistic communication methods, extremely sophisticated diplomatic skills, and pleasant speech.
Thinking jump
Has mental talent and creativity, as lightning-fast understanding, strong logic reasoning and learning ability. Able to perceive things through intuition, and often interested in mysteries and science fiction. However, the thinking may be too fast, and the interest may be changeable. This is not in line with common sense and lacks patience and determination. When learning,
Capture wind and shadows
Lack of patience in relationships with friends, especially between men and women. This may be caused by distrust of the opposite sex.
Character

Taurus people are often said to be cool and cool. But they are usually gentle. When they are angry, they will never tell anyone the reason. They hate being forced. They are a bit dull in front of people, but they are actually very smart, careful, everything in their eyes actually understand. They hate to explain or argue about something, so others always mistakenly think that Taurus does not know anything.
It is said that Taurus is greedy, but greedy is different from pursuing food. Taurus is very picky, just like exquisite delicious things. I like to access high-end restaurants, and I am also very interested in cooking. And in terms of food, their cleanliness is very obvious.
Taurus people only spend money on what they think is worth, and never spend what they shouldn't, so people always feel that they are very stingy and love money.
They are always happy in front of people, but inadvertently, they reveal sad thoughts and eyes. Strong and painful; proud but inferior; Sunshine is full of melancholy. They see everything in the world too well, but are still willing to believe in beauty.
Taurus people have a special character, and they are very gentle to everyone. But it is not because you have a crush on you that you are gentle and considerate, because they are such people. Therefore, there will always be many misunderstandings, so there are often a bunch of pursuers, and they will not change their minds. Generally, I like the full text of ...... the rest>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.